Skip Navigation

[Resolved] How to move a custom post type to another custom post type

This support ticket is created 5 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 7 replies, has 2 voices.

Last updated by charlesB-5 5 years, 7 months ago.

Assisted by: Christian Cox.

Author
Posts
#1260049

We have created a post type "Evidences" but the client has changed the site structure and would like to move the existing post type "Evidences" to a newly created post type "Extraits". Is it possible? What will happen to the relationships? Thanks

#1260219

Migrating posts into a new post type is one thing, but migrating post relationships between post types is another. I don't know of a simple way to migrate post relationships, because not only will the connections change but the post relationship itself must change. If you end up using different post IDs for these new Extraits posts it will be even more of a challenge. At that point you would have to export and re-import your site content including those post relationships.

#1260229

Thanks - I understand - As we have about 800 posts in "Evidences", is there an easy way to migrate the posts without the relationships? Tha would save us a lot of time than to have to move them manually. Thanks

#1260301

I would export the post content from this post type using the WordPress Export tool. That will generate an XML file. Then I would edit that XML file using a text editor application, and change all the post types from the old post type to the new post type. Then I would make sure the new post type is added in wp-admin. Then I would re-import the data into the site.

#1260337

We'll try this today. I'll let you know. Thanks

#1260467

Working great. Is there a way to bulk edit relationships and custom fields associated to a custom post type?

#1260473

There's no way to bulk edit custom fields, at least not built-in to the Toolset software. Other 3rd-party tools claim to be able to handle this, but I can't vouch for any of them. For bulk-editing post relationships, there is a post relationships API that might be useful. Here's another ticket that discusses bulk post relationship assignment: https://toolset.com/forums/topic/bulk-assign-child-posts-to-parent-post/

#1261463

All worked perfectly including the bulk relationship. Thank you very much!