Get Page ID by SHORTCODE in WordPress

For WordPress developer, sometimes we are required to know in which page the shortcode is placed and this example will show the function to get that page id/permalink within very small pieces of code.

Just paste the below code in functions.php file:

 

 

Now if you want to get the URL of your desired shortcode just call that function with SHORTCODE name. Example if your shortcode name is [CONTACT-FORM] then call the below function:

I hope this tutorial helps lots of WordPress developers to get a nice solution. If anything still you want to know, feel free to contact below.

Thanks.

This post has already been read 1419 times!

Mehedi Hasan

Cool WordPress Developer having much agile experience to develop any kind of WordPress sites & plugins. Also good in troubleshooting, fixing & making any kind of tweaks for WP site.

More Posts

Mehedi Hasan

Cool WordPress Developer having much agile experience to develop any kind of WordPress sites & plugins. Also good in troubleshooting, fixing & making any kind of tweaks for WP site.

One thought on “Get Page ID by SHORTCODE in WordPress

  • March 2, 2015 at 7:27 pm
    Permalink

    18 Sep 2014 . It is found everywhere writing essay graduate school the world. . This makes India help with an essay title to the worlds largest proportion of .
    best essay writing service
    In my opinion . . . I’m not sure about this, but . . . Announce your intentions. Do not flatly announce what you are about to do in an essay. . What follows is an explanation of each of these patterns with examples from real magazine .

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *