From a bilingual custom post type to two translated posts
-
Hi!
We recently moved a database of 1300-ish entries to WordPress.We created a custom post type for these, and added custom fields such as French Description – English Description in the same post.
The rest of the site is translated with Polylang and is working fine (like all of our websites using this plugin). But we have issues with those custom posts and we want to get them into Polylang.
I’m trying to find out how to do it. Here’s my steps for now:
– Making sure the language of all posts is set in wp_term_relationships
– Duplicate posts from wp_posts (making sure to adapt guid and slug)
– Duplicate all of the original post data from wp_postmeta and change the post id to the new id
– Set the language of the new post in wp_term_relationships
– Add to wp_term_taxonomy: post_translations: a:2:{s:2:”fr”;i:ORIGINAL ID;s:2:”en”;i:NEW ID;}And then I need to link the two posts together, I guess in wp_terms, using term_id from my newly created entry in wp_term_taxonomy. But I have no idea how to get name and slug values, which I see should start with pll_
Can you help me with this one? And do you think my first steps will work?
Thanks in advance!
- The topic ‘From a bilingual custom post type to two translated posts’ is closed to new replies.