What's the _wp_desired_post_slug value for?

oquiroz asked
plugins redirect
via

I’m trying to debug a 301 redirect that is causing me lots of trouble. I renamed a page from /blog to /old-blog and created a new page with the /blog slug. Now I’m getting 301 redirects from /blog to /old-blog. I already tried to look for the value in the wp_postmeta table with the meta_key _wp_old_slug but it isn’t showing up.

I did found 2 entries with the blog meta_value under the _wp_desired_post_slug meta_key. What are these values supposed to be for?


Answer
via

See this line in WordPress core.

Explanation: When you move a post to the trash, _wp_desired_post_slug holds the slug that was desired for that post (now in the trash); i.e., when you move a post to the trash, WordPress suffixes the old slug so that it becomes available again, but it remembers the slug that you desired, just in case you decide to move it out of the trash and restore it.

Share This
Posted in: