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 3 replies, has 2 voices.

Last updated by Otto 3 years, 7 months ago.

Assigned support staff: Otto.

Author Posts
March 14, 2016 at 8:20 am #836849

carecweb

I need to populate the database with sample translations in order to test WPML performance with "Live" data. Default language is EN.

I was hoping cycle through perhaps a limited set of translated posts (say 20, data stored in PHP script) and then use a WPML API to insert them randomly as translations of EN posts, passing through the En post's ID. In addition, I hope to have a similar API to copy the post metas from EN to their translations, as well as insert their translated taxonomies (translated taxonomies are insert through the Taxonomy Translation page of WPML), both given the EN post IDs as well.

This old post however, mentions that such API does not exist, that we need to insert posts manually using wp_insert_post(), compute a TRID, and then insert into icl_translations.

https://wpml.org/forums/topic/wp_insert_post-and-wpml/

My question is have you been able to develop such API finally, or do we have to resort to that tedious programming specified in that post? In case of the latter, does that mean that we also need to create programs to lookup and insert in postmeta and the three taxonomy tables as well?

Thanks

March 14, 2016 at 4:15 pm #837399

Otto
Supporter

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

Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

Hello,

Thank you for contacting the WPML support!

For being of better help, can you please provide your WPML Debug information in the debug field below? http://wpml.org/faq/provide-debug-information-faster-support/

I think that the bulk duplication feature will do what you need. Please take a look at this documentation:
https://wpml.org/documentation/translating-your-contents/displaying-untranslated-content-using-content-duplication/

If this is not what you are asking, can you please elaborate on why this is not an option so I can better understand?

Thanks for your cooperation.

Kind Regards,

Otto

March 15, 2016 at 7:07 am #837807

carecweb

Thanks for the prompt response Otto. Please allow me 1-2 days to test out this bulk translation feature.

March 15, 2016 at 12:37 pm #838187

Otto
Supporter

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

Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

Sure, let me know if it helped once you can test it.

Kind Regards,

Otto

The topic ‘[Closed] Inserting translated posts, post metas, and taxonomies programmatically’ is closed to new replies.