I just changed the URL of one of my posts from




Now, if I go to the old url, I get redirected to the new one. This is great of course!
...But is this a feature of WordPress, or what's going on here?

Does WP keep track of a post's URL history, providing rewrites/redirects for former URLs?
Looking at the response header I see WP is sending out a SEO friendly 301 redirect... Yes!?
I thought I'd have to set up those redirects using rewrite rules in my .htaccess, so I'm curious to know how it happens that WP is giving me my new URL when I type in the old one.

Any light on how WP handles this would be appreciated.

1 Answer 1


Does WP keep track of a posts url history, providing rewrites/redirects for former urls?

Yes it does. If you change a post slug, wordpress 301 redirects the old to the new URL (if your server setup allows it).

Any light on how WP handles this would be appreciated.

Unfortunately, I've never seen this feature properly documented in the codex. Hence I cannot tell you which wp core function does this and where in the core it is located.

What I can tell you though is this: The previously used slug(s) are stored in the database in the wp_postmeta table. Check for _wp_old_slug in the meta_key column (the actual slugs being stored in the meta_value column). Hence should you ever want this default behavior not to happen in a particular case, this is where to delete a value.

More often than not this feature is very helpful. It screws up though, when you rename a post and later on create a new post with the same name the other one had had earlier.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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