Yesterday, I wanted to write a useful post on my site. Basically, all my posts are for you all who find my posts useful. I started to write my post very late (3 a.m.) and I was sleepy. I finished my post and am ready to publish. But I wrote the content on the page instead of the post. I normally write my post a bit long to explain and give the samples to you so you can follow along with my post without any issues.
Well, I can change the post type by updating the database if I want. But if there are some plugins that do the job why do I spend time coding by myself? So I found a Post Type Switcher plugin that does the job very well.
With the plugin, you can convert:
- Page to Post
- Post to Page
- Post to Custom
- Custom to Custom
Note that, the invisible post types such as revisions, menus, and so on are excluded from this plugin. If you really need to convert those invisible post types, you will use the ‘pts_post_type_filter’ filter. I don’t cover this filter in this post.
Backup Your Site
Once you install and activate the plugin, navigate to the page or post or custom post-type item you want to convert. Then use the quick edit and change to the post type you want. See the screenshot below.
After converting the post type, check the converted post type. If the converted post type looks good to you, you are done. But if not, you may use the backup to restore the previous data back. Then you will convert the post type by updating the database instead. For me, I convert from page to post with the plugin and it works as I expect. No issues occur. And that’s it for today.