Using translation multilingual plugins with WP Rocket

Automatic compatibilities

WP Rocket has automatic compatibility with the following multilingual/translation plugins:

WPML

  • WP Rocket will detect your language configuration and will cache/purge/preload the content.
  • You have the ability to empty/preload the cache for a specific language or for all languages at the same time if you are using the “Different languages in directories” option in WPML. Otherwise, when you click on the Clear and preload cache > All languages button, all cache files will be emptied but only the URLs of the main language, i.e. those with no query string, will be preloaded.

    clear cache languages

WooCommerce Multilingual

  • This is an add-on for WPML. WP Rocket uses dynamic and mandatory cookies to provide compatibility for the currency switcher and geolocation.
  • When the Geolocation option is active, this cookie: wcml_client_country must be set in the visitor's browser before caching will start.
  • Specific cache files will be created for each value of the following cookies:
  • wcml_client_currency
  • wcml_client_currency_language
  • wcml_client_country

Polylang

  • WP Rocket will detect your language configuration, and will cache/purge/preload the content.
  • You have the ability to empty/preload the cache for a specific language or for all languages at the same time.

Polylang browser language detection

When using Polylang's browser language detection feature, note that the first visit for each user will be uncached so that the language can be accurately detected. Once the cookie that stores their language, pll_language, has been set in the visitor's browser, caching will be activated.

Redirect to default language

If you have set up Polylang to have each language in a sub-folder, e.g. https://example.com/de, with a redirect from the homepage to the default language, you may find that the redirect doesn't work as expected. 

The solution is to exclude the homepage from the cache. 

In WP Rocket, go to Advanced Rules → Never Cache URL(s) and enter: /, this will allow the redirect to work reliably.

If your site uses additional cache layers, this option may cause your pages not to be cached and optimized by WP Rocket, so you may need to either leave this option disabled or disable the other cache layers.

TranslatePress

WP Rocket is compatible with the TranslatePress plugin from version 2.5.7 or higher.

  • When doing regular update of a specific post, WP Rocket will clear the cache of all versions of translated content.
  • When updating the post using TranslatePress UI, WP Rocket will clear the cache of updated language versions.
  • You have the ability to empty/preload the cache for a specific language or for all languages at the same time.

Other multilingual plugins

GTranslate

The free plan of GTranslate is compatible with WP Rocket. However, the GTranslate paid plans may require additional actions. For more information, please refer to the article: Using GTranslate with WP Rocket.

Weglot

Weglot's team has developed partial compatibility from their side, using WP Rocket's mandatory cookie approach.

When Weglot's "Auto redirection" option is checked, a language cookie will be set in the visitor's browser, and, from the next page reload, WP Rocket will serve the cached page for the default language.

However, the auto-redirection as such won't work, the visitors still need to use the language selectors to be redirected to the additional languages in needed.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.