Skip to content

Polylang

New in 3.19.0 (Pro). Two dispatcher tools work with Polylang (the free edition is enough):

ToolDefaultPurpose
polylang-readOnLanguages and settings, translation groups, pages missing a translation, a page’s text as numbered segments, string translations
polylang-writeOffTranslate 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.

  1. add-language for each language, for example {locale: "fr_FR", slug: "fr", name: "Français"}. The first one becomes the default; set-default-language changes it.
  2. Content that existed before Polylang has no language. assign-language with {lang: "en", post_type: "page", without_language: true} assigns 500 per call and says how many remain.
  3. link-translations joins pages that already exist in different languages.
  4. set-menu-location gives each theme menu location a menu per language.
  5. update-settings changes Polylang’s settings. Changing the URL mode (force_lang) or rewrite changes every URL on the site and needs confirm: true.
  1. Copy it. create-translation with {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-translation makes one.
  2. Read its text. get-page-text returns 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.
  3. Write it back. apply-page-text takes 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.
  4. Publish. set-status with publish. 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.

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.

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.