Changing to different post type maintains the redirection?
I use Post Type Switcher to switch some of my blog post type from ‘post’ to ‘docs’ ( a custom post type), thus the URL is changed from /blog/*
to /docs/*
. I note that the original post at /blog/*
( eg: /blog/someinfo
) is automatically (301) redirect to /docs/*
( eg: from /blog/someinfo
to /docs/someinfo
).
Changing the post type from ‘post’ to ‘page’ also has the same effect.
I thought that this is well explained by the WordPress creates redirect from old URL after changing slug question. So I use SELECT * FROM
wp_postmeta where meta_key = "_wp_old_slug"
to confirm that the redirection is indeed stored there. But to my huge surprise, I can’t find anything that has anything to do with the above redirection.
( If on the other hand, I just change the slug manually and not changing the Post Type, like changing the url from /blog/someinfo
to /blog/someinfo-2
, then I would see something at meta_value column, and hence I can rest assure that the redirection is real and permanent).
This creates a confusion for me. Where the redirection information is stored? Is the redirection permanent if I change Post Type? ( ie: /blog/someinfo
will always be 301 redirect to /docs/someinfo
)
Leave an answer