This integration is available from the Essential plan and above.
Setting up WordPress plugin
To get started, open your WordPress admin page and proceed to Plugins > Add new.
Enter "lokalise" in the search box and press Install now next to "Lokalise Companion Plugin".
It is also advised to install WPML plugin that allows to manage multi-lingual content. Please note that is a third-party solution not maintained by Lokalise. We are planning to add support for more multi-lingual plugins in the future.
Proceed to Settings > Lokalise.
Copy the Authorization secret key.
Next, proceed to your Lokalise project and open Settings > Integrations > Wordpress.
Enter your Wordpress site hostname (for instance,
https://example.com) and the Lokalise secret obtained at step 5.
Authorize Lokalise by pressing Accept.
Custom post types
By default, WordPress comes with two basic types of contents: 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 Lokalise plugin.
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.
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 in 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.
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:
Tag named after the post or 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 new ones. You will see the list of the currently imported 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!