Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

2 Answers 2

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.

Usage

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

 
discard

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.