Setting up WPML

Simply Static is completely integrated with WPML out of the box. In this tutorial, I want to show you how it works and what you may need to configure to get the best result possible.

Settings per language

In most cases, configuring the settings for “All languages” is what you want. To do that, use the little admin toolbar option from WPML while configuring the Simply Static settings:

Setting up WPML 1

This will make sure Simply Static is using the exact same settings, no matter which language is selected in the admin area, while starting a new static export.

However, you can configure some specific modifications per language by selecting a specific language while editing the settings. Let’s say we want to use a different export directory for the German website:

Setting up WPML 2

Exports by language

The same approach can be applied while doing static exports. Visit Simply Static -> Generate and change the language if you like to export specific language versions of your website – use “All languages” for a complete static export:

Setting up WPML 3

Forms Integration

The good news here is that nothing needs to be translated within the forms integration of Simply Static Pro. Just make sure to create new form integrations for each language version of your form.

Let’s say you are using Contact Form 7 and translate your forms via the WPML helper plugin as described here. You will notice that WPML is creating duplicate forms for each language version of your website.

Make sure you create a form integration for each version, as they all have a unique ID.

Setting up WPML 4

Search integration

The search integration is completely integrated with WPML. It will automatically create entries for each language and only show results based on the visitor’s language. That works for both, Algolia and Fuse.js.

Modify default WPML settings

To get the most out of the integration, I recommend modifying some of the WPML default settings. There are specifically two settings you should check:

Auto-Language redirect

Simply Static implements its own solution for the language redirects in WPML. It’s based on the implementation of WPML but optimized for static websites. Please make sure you have deactivated the original option in WPML to avoid any conflicts.

You can find the option in WPML->Languages->Browser language redirect:

Setting up WPML 5

Language Switcher Options

To avoid any unwanted redirects on your multilingual static website, you should deactivate the auto-redirect of missing translations to the homepage:

Setting up WPML 6