How to Switch Post Types in WordPress

One of the main challenges when redesigning this blog recently was how to deal with the WordPress Plugins section. In the old site it was a set of hierarchical pages that were difficult to maintain and required a bit of work to set up. It was rather shoehorned in. As such, I redesigned this section to work with custom post types of “plugins”, which allowed me more control as to how each were displayed, and allowed custom fields to be commonly defined between each plugin post, without polluting the pages with custom fields. Try saying the last sentence fast.

A potential problem occurred upon testing, in that – whilst I could copy and paste the pages into the new post type, it would be a fairly long and laborious process, that was open to mistakes. A quicker way would be to “switch” post types, preserving the content already written and optimised, but saving me a lot of time.

Thankfully, I found a plugin that could allow you to switch between each post type – Post Type Switcher.

post-type-switcher-sidebarThe plugin, written by John James Jacoby and Matthew Gerring is a simply, lightweight solution for switching post types. Upon installation, an extra drop down is added to the “Publish” admin widget that allows you to select the post type of the post. By hitting “OK” and then re-saving the post, any post features that are associated with that post type (such as custom taxonomies, or custom meta boxes) are then added to the admin screen, allowing you to make the relevant changes.

I did this on the 10 plugins I had, and – although I did a quick check to make sure everything looked okay, it took me a few minutes, rather than half an hour or so of boring copy and pasting.

I did spot one issue, in that in WordPress 4.0 at least the “quick edit” adds a number of these switcher boxes. However I don’t consider this a massive issue – as this is the sort of plugin you use once in a blue moon, say if you are changing plugins or adding a new section to an already built website – when I was done using this plugin I simply deactivated it.

Anyway, if you need to ever switch a post or two between post types, then I’d recommend using Post Type Switcher, download it and be sure to give it a great review if it works for you.

Similar Posts