I have a super old blog that I upgraded from 2.0.7 to 3.1 by upgrading over multiple versions. One of my biggest concerns was losing all the link juice from my legacy URLs but they were clearly made at a time when I hadn’t considered how the URLs would need to change.
To my surprise I found that changing my permalink structure from
/articles/%category%/%postname%/
to
/id/%post_id%/%postname%/
went really smoothly as WordPress automatically looked up the appropriate URL — which is great.
But I’m wanting to know since Ive changed link structures, does it send 301 header messages so I dont lose link juice from 5+ year old links, or is there a way for me to force WordPress to do this for old URLs?
Thanks!
Yes, WordPress will do a “301: Moved Permanently” to the “real” URL. WordPress calls this “canonical”. When it hits a 404, WordPress will do a lookup on the URL fragments and attempt to find a post / page with that slug. If it finds one – it will do a
wp_redirect()
to the proper permalink of the post.