I have about 50 WordPress posts that I've imported from a previous site and I'd like to make them into a Types custom Post Type so that I have a bit more control of how they are being viewed on my site. Is there a way to convert them all at once? I'm not seeing anything in the Types documentation and the last Community Forum Post I saw regarding this was from 2012.
hidden link
Thanks in advance for your help!
Cheers,
Laura
Hi, there's not an easy way to move posts between post types from the wp-admin area. The two solutions I know of include manual database manipulation, or WordPress import / export with some manual XML file changes.
General idea for manual DB manipulation:
Create your new Custom Post Type using Types, then modify the database wp_posts table to update the post_type value for each of the posts you want to migrate. Set the new post_type value to match the new post type's slug. That's pretty much it for basic post migration. I can help you do this in phpMyAdmin, or by running a custom SQL query in your database if you need assistance.
General idea for import / export XML file manipulation:
If modifying the database isn't an option, you can export your posts using the WordPress export tool. Then edit the generated XML file using a text editor like Notepad or Sublime Text, and modify the wp:post_type node for each post to use the new post type slug. Import the updated file, then delete all the old posts from the old post type. Example update:
<wp:post_type><![CDATA[new-post-type-slug]]></wp:post_type>
If you have custom fields in these posts that need to be transferred over, that process is a bit more involved. We can discuss that in more detail if you want, but I'll need to know more about your setup and the custom fields in use.