Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 5 replies, has 2 voices.

Last updated by Vasileios 4 years ago.

Assisted by: Yvette.

Author Posts
April 14, 2020 at 4:33 pm #5906645

Vasileios

Tell us what you are trying to do?
At the moment there are too many categories in Posts.
I want to move all posts under Recipes and Products (not Woocommerce products) categories to their own separate CPTs with the corresponding taxonomies.
I tried it using Post Type Switcher plugin which works fine for switching post type, but I lose the translations. I also did not find a way to move i.e. a Product under a subcategory to the corresponding CPT taxonomy directly - but I did manage to do it manually after switching post type.
The translations though is an issue, as they 'disappear' after switching post type and I cannot locate them anywhere so I can manually assign them - if there is no other option.

Is there any documentation that you are following?
Could not find any documentation or a resolved thread on the subject.

Is there a similar example that we can see?

What is the link to your site?
It is a staging site at the moment
hidden link

April 16, 2020 at 12:19 pm #5922343

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Paris (GMT+02:00)

Hello

Hmmmm - when you "switch" post types, are new post-ids being assigned to the worpdress object?

For example, if you had a "post" that was categorized as a "recipe" and it had a post-id = 10, when you transform the "post" to your new CPT "recepies", does the post-id retain the value "10"?

To see this, you can open the post type in the wordpress editor and take a look at the URL. Normally you will see the post-id embedded within the URL.

Once I have this answer, I can better help you.

April 16, 2020 at 4:05 pm #5925409

Vasileios

Yes, new IDs were created (at least not the same with the posts or their terms).

April 17, 2020 at 7:53 am #5929867

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Paris (GMT+02:00)

Oh - too bad.

In this case, the translation links are undone. Does the language assignment remain intact? e.g. Post-id = 10 that had taxonomy = recipe is now post-id=100 of post-type=recipes. Postid=100 has same language assignment as postid=10.

If so,

You *might* be able to do the following:

1. In one language, switch post types under taxonomy in one lanugage
2. Switch languages, then swithc post types under taxonomy in 2nd langauge

3. You should then have 2 sets of new post-ids in different languag spaces. Do you?
4. You can then manually "connect with translations" the 2nd language recipes with their corresponding recipes post type in the 1st language.

Maybe you could try this as a test with one recipe.

April 24, 2020 at 11:00 am #5985323

Vasileios

The way I found it worked for my case was:

1. Disable WPML
2. Use Taxonomy Switcher plugin to bulk-move Posts of selected Categories to the respective taxonomies of the new CPTs.
3. Enable WPML and make CPTs translatable.
4. Update permalinks

I hope am not forgetting something, but this is the main process.
I managed to move the Posts to CPTs without loosing the translations.
After moving each set of Posts under a specific Posts Category, I had to manually assign CPT Terms of the respective CPT Taxonomy/Category ...using the Quick Edit option.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.