Search code examples
wordpresssquare-bracket

Find out where [ shortcode ] leads in wordpress


I'm no word press guru, but I think i have a good grip how to manage a site. The problem I'm having is that I have a site which i haven't done myself and i'm trying to delete a product from a page.

The page only have [productspage] as content though and i cannot for the life of me figure out where it gets the data from. Is there any way to find out where [productspage] gets the data? I've checked in widgets and other pages but even though i search i cannot find anything.


Solution

  • If you have access on the FTP, download the files in a local machine. Then use a software like Sublime Text 3 and its feature of "Search in files".

    Choose all the folders you downloaded from the FTP and search for the name of the Shortcode. In your example, search for productspage without the brackets of the shortcode.

    Probably, you will have many results. Some put it in functions.php, some others in new files. You need to find the right one which is a function with a similar name of productspage. Just to be sure, close to that function, you will find also something like this:

    add_shortcode('productspage','the_name_of_the_function_you_found');

    That function is what you are looking for. You will be able to check how it works and from where it retrieve the data.