LocalizationPro
Polylang MCP for post languages, translation sets and strings
The Polylang MCP abilities in GoBuildWP Pro organise translations that already exist; they do not write translated copy. An AI client can see which language each post carries, give a language to a post that has none, join separate posts into one translation set, and fill in the Languages > Translations table for widget titles, the tagline and registered theme strings. Every write returns what it replaced.
Fill in the French translations for our widget titles and footer strings.
wppilot/polylang-check-setupReadConfirms configured languages and the default; stops if none are set up.
wppilot/polylang-list-languagesReadReturns the exact slug to use, fr, rather than the fr_FR locale.
wppilot/polylang-list-stringsReadWith language fr and status untranslated, lists what is missing, each with its original, name and group.
wppilot/polylang-bulk-set-string-translationsWriteRuns first with dry_run to show each planned translation, then with confirm for up to 100 items; failures are per item.
- Edition
- Pro
- Abilities
- 9
- Requires
- WordPress 6.9+, PHP 8.0+, Polylang 3.6.0+
Abilities
Polylang abilities by effect
Inspect5
Create and change2
Reference: /docs/reference/polylang
Documented source abilities; live registration can be narrower. Edition and effect labels describe the source catalogue. The installed schema, dependency versions, licence, WordPress capability, safety profile and per-ability policy determine availability; labels alone do not prove confirmation or recovery.
Worked example
Translating widget and theme strings into French
Expected outcome to verify on the installed stack; this sequence has not been recorded as a runtime test.
The French pages show translated widget titles and footer text. Nothing can be rolled back from the change log, but each item in the result carries its previous value, which can be written back the same way. Polylang may sanitise a string differently from what was sent, and the result shows what was stored.
Inspect per-item failures and reread sanitized string values before accepting a batch. Check the French pages in a browser; successful storage of one item does not prove every requested string was saved.
polylang-check-setupConfirms configured languages and the default; stops if none are set up.
polylang-list-languagesReturns the exact slug to use, fr, rather than the fr_FR locale.
polylang-list-stringsWith language fr and status untranslated, lists what is missing, each with its original, name and group.
polylang-bulk-set-string-translationsRuns first with dry_run to show each planned translation, then with confirm for up to 100 items; failures are per item.
Data model
Terms carry the language, and the strings
Polylang stores a post's language as a term in its language taxonomy. The link between translations is another term, in post_translations, whose description maps each language to a post id for the whole set. That is why changing one post's language also rewrites a structure several posts share.
Strings are kept on the language terms themselves, in _pll_strings_translations meta, keyed by the exact original text rather than by a name. If a theme changes a sentence, the old translation stops applying. Polylang lists a string in its Translations table when a theme or plugin registers it with pll_register_string, and it only records those registrations while its own admin screens load.
For an agent, that means language codes must be the exact slugs Polylang returns, and a string must be addressed by its original text copied verbatim.
Limits
Polylang writes to plan carefully
- Test synthetic translated URLs after the exact grouping or string write. Check rendered text, response status, hreflang and canonical independently; saved grouping and supplied text do not prove translation quality or search eligibility.
- Assigning a language and linking a set are confirmed writes that cannot be undone from the change log, because both rewrite the post_translations group.
- A link call treats its language-to-post map as the whole set: read the existing links first so a partial map does not drop ones worth keeping.
- Every post in a set must share one translated post type and already carry its language. Term translations are not handled.
- When registration_complete is false, a registered string that has never been translated may be missing from the list until someone opens Languages > Translations.
- Polylang Pro services such as machine translation are not exposed.
Finding gaps, adding a translated page, keeping string fixes reversible
Which pages still have no German version? Reading Polylang coverage first
Before any Polylang MCP write, the useful first question is what is missing. polylang-list-content filters by post type, language, status and search, pages through up to a hundred items at a time, and returns each item's language with a summary of its translation set. Listing published pages in the default language and reading which sets lack a de entry gives a gap list without opening each page. polylang-get-content-language then shows the complete set for one page when you need to see exactly which ids are linked.
polylang-list-languages returns three codes per language, and they are used for different things. The slug, such as de, is what every write ability expects. The locale, such as de_DE, is the WordPress locale that translation files are loaded for. The W3C code is the hyphenated form browsers and hreflang attributes use, which makes it the value to compare against when checking the rendered head. The same list shows which language is the default and which are written right to left.
Right-to-left languages are worth a look before translators start. The language list says which are written right to left, and the theme has to support that direction for Arabic or Hebrew pages to read properly; check one translated page in a browser before filling a whole set.
Adding a translated page to an existing Polylang set, in order
The module does not write translated text, so a new translation is a short chain across two modules. The order matters, because a link call refuses posts that do not carry their language yet.
- polylang-get-content-language on the original page: note its language and every id already in its set.
- create-post from the core content abilities, as a draft, with the German title and content you or a translator supplied.
- polylang-get-content-language on the new draft: if it carries no language or the wrong one, polylang-set-content-language with confirm sets de.
- polylang-link-content-translations with the full map, every existing language and id plus de and the new id, again with confirm. A map that leaves out a language unlinks it.
- polylang-get-content-language once more on both pages, then publish the draft with update-post and check the language switcher and hreflang tags in a browser.
Correcting a bad string translation without losing the old one
String translations are the part owners edit most and the part with no ledger undo, so GoBuildWP changes the rules for overwrites. polylang-set-string-translation fills an empty translation freely, but replacing or clearing an existing, different translation is refused unless the call carries confirm=true. Each result returns previous, the value that was there before, and writing that value back the same way is the undo. Ask the agent to keep the previous values from a session in its reply before you close it.
For more than a handful of fixes, the bulk ability's dry run is the review step. It classifies every item as a create, update, clear or no-op against what is stored now, so a batch meant to fill gaps that turns out to contain updates is caught before anything is saved. A real run then saves each language once and reports success or failure item by item.
Polylang permissions, profiles and what stays in Polylang's screens
polylang-check-setup reports whether the connected user can edit posts and manage options, whether string translation is available on this install, and whether string registration is complete on the current request. On MCP requests registration_complete is false by design, because Polylang records pll_register_string() calls only on its own admin side; translated strings always appear, never-translated ones may not. Under the Read Only safety profile the inspection abilities run; string writes need Production Safe, and assigning a language or linking a set needs confirm on top.
Term translations, Polylang's language settings, URL modifications and the language switcher stay in Polylang's own screens, and Polylang Pro features are not exposed. The Polylang reference lists the parameters, and the Weglot page explains how a proxy-based translator differs.
- "Read only: which published pages have no Spanish translation yet?"
- "Show me every untranslated string in the theme group for fr, then dry-run filling them from this list."
- "Link page 210 as the Italian translation of page 18 without dropping the French and German pages already linked."
Polylang sites are no longer reported as WPML
Polylang includes a compatibility layer that answers some of WPML's functions, and before GoBuildWP Free 1.18.0 that was enough for the environment summary an agent reads first to call a Polylang site multilingual with WPML. The agent then reached for WPML tools that could not work. Polylang is now detected before WPML, so the summary names the right plugin and the Polylang abilities in Pro are the ones it uses.
Polylang keeps languages and translation links in two private taxonomies. A general taxonomy write aimed at either of them is refused, and the refusal now points to the Polylang abilities that change languages and links safely, instead of only saying no.
Questions
Polylang questions
Does the Polylang MCP translate my posts with AI?
No. It links posts that already exist and fills string translations you provide. Create the translated post with the normal content abilities first, then assign its language and link it.
Why is a theme string missing from the list the agent reads?
Polylang only records string registrations on its own admin screens. Opening Languages > Translations and listing again usually helps, but it is not guaranteed: a string the theme or plugin registers only in some contexts, such as one template or one front-end request, may still not appear. Check the Translations screen itself if a string is still missing.
A theme update changed some text. Why did its translation disappear?
Polylang keys each translation to the exact original text, so new text is a new string. Translate it again.
Can the agent undo a translation link it made?
Not from the change log. Read the set before linking, and relink with the earlier map if it needs to go back.
Where these facts come from
GoBuildWP behaviour is taken from the plugin source and the ability reference; third-party details from the vendor documentation below, checked by the GoBuildWP team.
Polylang is a separate product; no partnership or endorsement is implied.