This integration is available from the Essential plan and above.

Setting up WordPress plugin

  1. To get started, open your WordPress admin page and proceed to Plugins > Add new.

  2. Enter "lokalise" in the search box and press Install now next to "Lokalise Companion Plugin".

  3. It is also very much recommended to install WPML plugin that allows to manage multi-lingual content. While you can install Lokalise Companion plugin alone, it basically won't do anything as it does not allow to manage multi-lingual data (it's only used to import/export such data to/from Lokalise). Please note that WPML is a third-party solution not maintained by Lokalise. We are planning to add support for more multi-lingual plugins in the future.

  4. Proceed to Settings > Lokalise.

  5. Copy the Authorization secret key.

  6. Next, proceed to your Lokalise project and open Settings > Integrations > Wordpress.

  7. Click Connect.

  8. Enter your Wordpress site hostname (for instance, https://example.com) and provide Lokalise secret obtained at step 5.

  9. Authorize Lokalise by pressing Accept.

Custom post types

By default, WordPress comes with two basic types of content: Posts and Pages. These are called post types. However, many sites also feature custom post types. For example, a site could have Tours, Articles, or Book post types. Our plugin does support custom post types, however these must be made translatable. To achieve that, go to the WPML > Settings page and scroll to the Post Types Translation section. Please find more info in the WPML docs. Once you have made custom types translatable, they'll have language attributes and can be translated with the help of Lokalise plugin.

Known issues

Note for Apache users

If you are using the Apache web server, you might need to update your VirtualHost configuration for the authorization flow to work correctly (it is not usually required though). Specifically, add the following line at the very beginning:

SetEnvIf Authorization "(.+)" HTTP_AUTHORIZATION=$1

Then don't forget to restart your server.

Compatibility with other WordPress plugins and limitations

Lokalise integration might not work correctly with some other third-party plugins, especially with drag&drop site builders like WPBakery.

Currently we do not support translation of SEO metadata and media.

If something goes wrong

Make sure that:

  • You can open yourwebsite.com/wp-json/lokalise/v1/environment page.

  • You have enabled the WPML plugin and set it as a localization provider (visit yourwebsite.com/wp-json/lokalise/v1/environment to double-check).

  • Check that your permalink settings as set to anything but default (otherwise REST will not work).

  • Your login page is set to the default URL yourwebsite.com/wp-login.php.

  • You can receive data via API. Visit yourwebsite.com/wp-json/wp/v2/pages and make sure that content and excerpt are not empty.

  • You can retreive the list of locales at yourwebsite.com/wp-json/lokalise/v1/locales (the language names and language codes should not be empty or NULL).

Linking posts and pages

After setting up the plugin, you will see content currently available in your Wordpress.

To translate the content, you need to import it to your Lokalise project first. Importing effectively means downloading content from Wordpress and creating new translation keys on Lokalise. These keys will then be properly connected to your WordPress content.

Note that you can find a specific element using the search box in the top right corner, or narrow the scope using the Filter dropdown:

Next, choose one or more items to import to your Lokalise project. All languages that are present in Wordpress but missing in your Lokalise project will be created automatically.

Finally, press Import selected. The import process will happen in the background, and its status can be checked on the Activity page.

Translating content

After the items are linked, you may proceed to the Lokalise project dashboard and edit the content as usual. All translations imported from Wordpress will have two tags:

  • Wordpress.

  • Tag named after the post or the page. So, if the key belongs to the "Hello world" post, it will have a "Hello world" tag.

Managing imported items

Open Wordpress integration again to manage the currently imported items or import the new ones. You will see the list of all previously loaded items. Pick the items you'd like to upload back to Wordpress and click Export selected. Then choose one or more languages and decide whether you'd like to export empty translations:

This process will run in the background. Then return to your Wordpress and make sure the chosen items were updated properly!

Did this answer your question?