Skip Navigation

[Closed] Change a post from one post type to another

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 9 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 19:00 10:00 – 19:00 10:00 – 19:00 10:00 – 19:00 10:00 – 19:00 -
- - - - - - -

Supporter timezone: Europe/Madrid (GMT+01:00)

This topic contains 5 replies, has 2 voices.

Last updated by Caridad 9 years, 1 month ago.

Assisted by: Caridad.

Author
Posts
#275919

Hi,

My customer is working on inputting data and I had created 2 custom post types for him. He mistakenly entered some of them in the wrong post type and I want to change them to the other post type.

Post type A has X number of custom fields. This is the one he accidentally used for some posts that should be Post type B.

Post type B has the same fields as post type A (exact same fields) plus some additional fields not in A. So if I changed them from A to B, all the data would go to the correct fields since all fields in A exist in B.

I understand there is no way to do this in Types. I also understand that a plugin called post type switcher doesn't work correctly either. I'm wondering if there is a way to do this in phpmyadmin so my customer doesn't have to re-enter all that data. (it's quite a bit of work.)

#275990

It is as simple as changing the post_type in the wp_posts table if you dont have WPML enabled.

Also, we implemented a fix for "Post Type Switcher" so it should be working. However, it would a good idea to make a backup just in case.

#277831

Ok, I installed the Post Type Switcher plugin then, and it worked to switch post types. However, it also caused a problem. The 2 parent post types I need to be able to switch are basic listings and full listings.

There are child post types (associated with both) that are called scorecards and galleries.

For some reason, just changing the post type loses the already entered data for scorecards and galleries. Why would that happen? Aren't the field tables looking at the post ID which didn't change when switching the post type of the parent?

#278854

I think this may happen because of the way "Post Type Switcher" works.

Did you try changing the value of the post_type field directly in the wp_posts table?

#278860

No because you told me that you had made some changes that meant the post type switcher plugin would work correctly.

But something worse it happening here. Go to the WP admin and go to add new under basic listings. Make a fake listing. after you save, you can then add the fields table for scorecards (the child post type) to that golf course. But after you add them and save, then go back to the course, the entered data doesn't display anymore.

I don't know what's going on. It's really screwing up my development on this site. Please help! 🙁

#279810

We added a workaround in our plugins to work well with the post type switcher plugin.

The problem was detected and fixed for single posts, but I don't think we ever noticed the problem with parent/child posts.

We already have a report about this problem and we are still waiting for developers feedback on this:
https://toolset.com/forums/topic/updating-parent-destroys-child-in-many-many-post-relationship/

I have taken a note of this thread and we will get back to you when we have more information.

Are you able to edit the wp_posts table directly in the mean time?

Regards
Caridad

The topic ‘[Closed] Change a post from one post type to another’ is closed to new replies.