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.

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 -
- 12:00 – 16:00 12:00 – 16:00 12:00 – 16:00 12:00 – 16:00 12:00 – 16:00 -

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

Tagged: 

This topic contains 1 reply, has 2 voices.

Last updated by Dražen Duvnjak 1 day, 13 hours ago.

Assisted by: Dražen Duvnjak.

Author Posts
November 1, 2024 at 3:49 pm #16355568

Will Macowski

Background of the issue:
We are trying to convert posts into custom post types based on their categories, optionally mapping certain categories and tags to new terms in new taxonomies associated with the new post types. For example, all 'blog' category posts become the 'Article' post type, and if they have the post tag 'ipv-therapy', they are assigned to the new 'Product Line' taxonomy term of 'ipv'. We need to ensure all translations attached to posts also convert and stay attached. We need to ensure the old permalinks are redirected to the new permalinks, in case users have bookmarks or links in emails, etc. We have tried some export/import plugins, post type switcher, and then our own WPCLI function. We have some success migrating the original posts, but not all translations transfer along with them. We are able to provide our CLI code if needed.

Symptoms:
Not all translations transfer along with the original posts during migration.

Questions:
How do we effectively convert posts to custom posts along with translations?
How can we ensure all translations attached to posts convert and stay attached?
How can we ensure the old permalinks are redirected to the new permalinks?

November 6, 2024 at 8:07 am #16369980

Dražen Duvnjak
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Hello,

thanks for contacting us.

What I suggest first is to disable WPML plugin, and make sure that all posts are correctly converted to your new CPT. When WPML is disabled they will all appear in the same language.

After that, you can enable WPML and need to connect posts as translation manually (https://wpml.org/faq/how-to-link-already-translated-pages/) or via code using our hook wpml_set_element_language_details

- https://wpml.org/wpml-hook/wpml_set_element_language_details/

If you need help with custom coding we suggest hiring a WPML contractor: https://wpml.org/contractors/

Hope this helps.

Regards,
Drazen