Polylang
New in 3.19.0 (Pro). Two dispatcher tools work with Polylang (the free edition is enough):
| Tool | Default | Purpose |
|---|---|---|
polylang-read | On | Languages and settings, translation groups, pages missing a translation, a page’s text as numbered segments, string translations |
polylang-write | Off | Translate pages, manage languages, links, term and string translations, menus per language and settings |
Enable the write tool under Tools > Plugins > Polylang. Languages and settings go through Polylang’s own controllers, so Polylang checks every change.
Set up a site
Section titled “Set up a site”add-languagefor each language, for example{locale: "fr_FR", slug: "fr", name: "Français"}. The first one becomes the default;set-default-languagechanges it.- Content that existed before Polylang has no language.
assign-languagewith{lang: "en", post_type: "page", without_language: true}assigns 500 per call and says how many remain. link-translationsjoins pages that already exist in different languages.set-menu-locationgives each theme menu location a menu per language.update-settingschanges Polylang’s settings. Changing the URL mode (force_lang) orrewritechanges every URL on the site and needsconfirm: true.
Translate a page
Section titled “Translate a page”- Copy it.
create-translationwith{post_id, lang}copies the page with its Elementor or block content, settings, template, password and featured image, maps its parent and categories to their translations and links it to the original. The copy is a draft. It lists any category that has no translation yet:create-term-translationmakes one. - Read its text.
get-page-textreturns every translatable string as a numbered list: Elementor widget text and links, Gutenberg block text (paragraphs, headings, lists, quotes, buttons, image alt text and captions, details, search), the title, the excerpt and the Yoast, Rank Math or SEOPress title and description. - Write it back.
apply-page-texttakes the translated list in one call. Every segment is checked first; one bad segment and nothing is written. Large pages can go in several batches. - Publish.
set-statuswithpublish. Publishing needs the right to publish pages.
Text in places the tools cannot safely change (the HTML widget, dynamic tags, third-party blocks, other page builders) is listed as skipped; edit those with the builder’s own tools.
The original page stays as it is
Section titled “The original page stays as it is”Polylang can copy dates, page order, custom fields and categories between translations. While EMCP writes a translation it holds that copying back for what it writes, so translating and publishing the French page never changes the English one. If Polylang copies something anyway, EMCP reverses its own write, leaves the other page as it is, and History gets an entry that restores it.
History
Section titled “History”Every write is recorded in History and can be undone there, except deleting a language (delete-language needs confirm: true, and dry_run: true first shows how many posts and terms use it). Undo refuses to overwrite anything someone changed since: a copy that was edited is not deleted, and a language that pages use is not removed.
Polylang Pro features (shared slugs, translated slugs, machine translation) are not available.
