Published 28th September 2012
I wonder how many of you have been in the same situation as me where you are building a site on your local machine and you add some content in the WordPress post editor, then you go to add some links and realise “wait these URL’s are going to be wrong when I move to a live site”. So you have to remember to change them when you migrate to a live site, or even just a different URL.
That’s why I created the URL & Path Shortcodes WordPress Plugin. Now when you are adding links in your post editor you can set the URL to:
[Some Page]([home_url path=)
Then when you import this content to your new site, as long as you have the plugin installed, the URL will remain correct.
This plugin provides shortcodes for most of WordPress’ directory functions including:
You can even pass in parameters that are available to the corresponding WordPress functions. For example:
[home_url path="faq" scheme="https"]