WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am creating a post and would like to link to other post on my blog. What is the best way to do this? I don't want to hard link in case I update the post title. Is there a way to do this?

share|improve this question
up vote 4 down vote accepted

Use the ugly link instead of the pretty link. For example, if your post id is 123, you can link to http://www.yoursite.com/?p=123. This will automatically get rewritten to your current pretty permalink.

If you do it relative from the root, it also keeps the link intact if you change your domain name. (ex. href="/?p=123").

To find the post ID, hover over its "edit" link in the WordPress admin. Look at the target URL, and you'll see a "post=1234". The number is your post ID.

share|improve this answer
How is it rewritten to current pretty permalink? – Brig Mar 30 '11 at 18:00

Use a shortcode. I’ve made one for the same reason in my shortcode plugin.


Install the plugin Simply Show IDs to find the post IDs. Insert a shortcode into your posts that refers to the ID:

[link id=42 title="Foo" class="bar"]Hello World![/link]
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.