Does Post Type Switcher store the redirection information? #41
-
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 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 This creates a confusion for me. Does Post Type Switcher store the redirection information in the WordPress database? If yes, at where? I go through the source code, and it seems that the plugin only changes the database only once, at one type, at set_post_type, so no redirection information is written. How the redirection is accomplished? Anyone can shed any lights on this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Great question @WindingWinter! Here's how WordPress handles this (without the Post Type Switcher needing to do anything) https://developer.wordpress.org/reference/functions/redirect_canonical/ It's pretty awesome! |
Beta Was this translation helpful? Give feedback.
Great question @WindingWinter!
Here's how WordPress handles this (without the Post Type Switcher needing to do anything)
https://developer.wordpress.org/reference/functions/redirect_canonical/
It's pretty awesome!