How to switch / convert Custom Post Types In WordPress
Custom post type is one of the most powerful feature of wordpress that give its developer immense power to customize this very simple to use blogging platform to convert it to suite any requirement. Premiums Themes and plugins do use custom post types to store testimonials, photo galleries, portfolios, companies profiles, this list is endless.
But this is also an issue when you want to change your theme or the plugin you are using on your site, is no longer maintained.
What will you do ? Will write the whole information again?
WordPress save all type of post information in a single file wp_posts table and defined the type of post in an attribute post_type using this information you can convert all or any of your custom post into normal wordpress post.
Luckily, there’s a couple ways to convert custom post types to standard post types. I recommend using Post Type Switcher if you just have a couple items to switch. For converting posts in bulk, Post Type Converter is what you’ll want.
Convert Custom Post Types using Command Prompt
Please make very sure that you have proper backup of your database before executing the following
Login into Phpadmin Panel of Your Database, select your database and issue the following command in command Prompt
update wp_posts set post_type =’Your New Post Type’ where post_type =’Old Post Type’
Update wp_posts set post_type =”post” where post_type =”testimonials”
Above sql query will convert testimonials type custom posts as your regular posts.
but if you want to convert any specific post into another type then you can issue this command
Update wp_posts set post_type =”post” where post_type =”testimonials” AND id =45
where 45 is the post number of your post.
Change Custom Post Type Using post Type Switcher/Post Type Converter
if you are little bit less comfortable with programming and using phpmyadmin, then use these plugins, specially built to convert one post type into another post type- Post Type Switcher
The problem with this WordPress plugins is- You have to convert one post at a time into another post type but very useful, if you have very few post to convert.
In case you want to convert a good amount of custom post into another post type then post type converter is for you. ( This plugin is not updated for more than 2 years, so use this plugin at your own risk )
Adds meta boxes to all post types and allows you to convert the post type of the current post you are editing to a different post type. This is very useful when doing an import from another site into one post type that then needs to be filtered into different post types or even to fill dummy posts throughout multiple post types