Opens in a new tab

Multilingual sites (Polylang)

Each language keeps its own address, its own tags and its own static copy. Polylang is the reference; WPML is supported.

One site, one static copy per language

On a multilingual site, every translation is a page of its own, with its own address. MyStaticWP treats it that way: each translation is rebuilt, turned into a static page and served separately, so a visitor who reads your site in Spanish receives a Spanish static page, with Spanish tags in its code.

Polylang is the reference. MyStaticWP was built and tested with it, on a site in three languages (French, English and Spanish). WPML is supported through its documented hooks, but it has not been tested on a real WPML site yet, and this page says so where it matters.

MyStaticWP does not translate anything. It keeps what your multilingual plugin produces, and makes sure the static copies stay in step with it.

  • Each language has its own static page.
  • Saving a translation refreshes its sibling translations.
  • Forms replaced in Strict style speak the language of the page.
  • The plugin’s own screens follow your administration language.
On this page

What is supported

Plugin State
Polylang Built and tested on a real site with three languages. Use it as the reference.
WPML Supported through its documented hooks and switching functions. Tested with simulations only, not on a real WPML site. Check your own site after switching static mode on.
No plugin A single-language site works as usual.

What is in the static copy of each language

The static copy of a translation is the page exactly as your multilingual plugin renders it. That includes:

  • the address of that language (for example /en/contact-us/);
  • the <html lang> attribute of that language;
  • the canonical address and the hreflang links to the other languages;
  • the language switcher, with the addresses of the other translations.

Nothing is merged between languages. Each language has its own file, and a page in one language is never served for another.

Regenerate all counts every translation

Regenerate all rebuilds every translation of every page, and the blog index and archives of each language. The journal on the Switch screen lists them as separate lines, including the archive addresses of each language, for example /es/ and /en/category/….

The number of pages in the progress bar and in the Overview therefore includes all translations. A site with 14 pages in three languages counts 42.

Saving a page refreshes its translations

The language switcher in a static page holds the addresses of the other translations at the time the page was built. If you save a translation, MyStaticWP also rebuilds its sibling translations, so the switchers stay current.

  • You change the address of a translation: its old static file is removed, and the new address is built.
  • You save a translation with Polylang’s own editor: the siblings are rebuilt too.
  • You add a new translation: the page and its siblings are rebuilt.

The home page and the bare address

Multilingual plugins often send a visitor from the bare address of the site (example.com/) to a language, for example from the browser language. A static copy served in place of that address would skip the redirect.

For that reason, when Polylang or WPML is active, the bare address is always answered by WordPress, and never by a static file. Every language’s own home page, such as /en/, is static and served normally.

If the default language of your site has no prefix in its addresses, its home page is the bare address. It stays dynamic, and only that one page is affected.

Styles and plugin choices per translation

Each translation is a page of its own for MyStaticWP, so each one has its own row on the Pages and Plugins screens.

  • A Spanish page can be in Hybrid while its French and English versions are in Strict.
  • You can block a plugin on a translation and keep it on the others.
  • Category styles apply to all languages of that category.

To keep languages consistent, set the style at the category level, and override a translation only when you have a reason to.

Forms in Strict style

In Strict style, each form is replaced by a message. The message speaks the language of the page, read from its <html lang> attribute:

Page language Message
French Ce formulaire n’est pas disponible ici.
Spanish Este formulario no está disponible aquí.
Any other This form is not available here.

The contact address below the message is the one you set on the Switch screen. It is the same for every language. The message follows the page, not the person who triggered the rebuild, and it does not depend on any multilingual plugin.

Headers, footers and menus

Your headers, footers and menus in each language are yours: they are templates and menus you create with your builder and your multilingual plugin. MyStaticWP turns what they produce into static pages.

  • A change to a menu or a header or footer template rebuilds the whole site, every language included.
  • If a language shows no header or footer, the cause is in the template conditions for that language, not in the static copy. Compare with the live page.

The plugin’s own language

The screens of MyStaticWP are available in English, French and Spanish. They follow the language of your administration: any French locale shows French, any Spanish locale shows Spanish, and every other language shows English.

This has nothing to do with the languages of your site. A site in five languages managed from an English administration shows English screens.

Check a multilingual site

  1. Turn static mode on and click Regenerate all.
  2. In the journal, check that every language appears, including the archive of each language.
  3. Open a page in a private window, in each language. Check the language switcher and the address bar.
  4. View the source of one page and look for the <html lang> attribute and the hreflang links.
  5. Open the bare address of your site and check that your language redirect still works.

What MyStaticWP does not do

  • It does not translate your content, your menus or your templates.
  • It does not decide which language a visitor sees. Your multilingual plugin does.
  • It does not manage the language files of other plugins.
  • It has not been tested on a real WPML site.

If something looks wrong

  • A translation shows the wrong language. Check the page live first. If the live page is right, save the page again or use Push this page.
  • The language switcher points to an old address. Save the translation whose address changed. Its siblings are then rebuilt.
  • The bare address does not redirect. It should always reach WordPress. Check your multilingual plugin’s redirect setting, and try in a private window.
  • A language is missing from the journal. Check that its pages are published, and that your multilingual plugin lists them.
  • You use WPML and something looks off. Compare the static page with the live page, keep that page dynamic if needed, and tell us.

The styles are explained in Generation styles: Hybrid & Strict, the rebuilds in Regeneration & rebuilds. For other problems, see Troubleshooting.