Skip to main content
WordPress

Learn how to exchange posts and other items between WordPress and Lokalise with ease.

Ilya Krukowski avatar
Written by Ilya Krukowski
Updated over 3 months ago

This feature is available from the Essential plan and above.

The Lokalise WordPress plugin makes it easy to import and export multilingual content, streamlining the translation process for your site. In this guide, we’ll walk you through how to set up the plugin, import your WordPress content into Lokalise, and sync your translations back to WordPress.

Prerequisites

Before getting started, note that WordPress doesn’t offer built-in multilingual content support. To manage translations, you’ll need to install a separate plugin.

Currently, Lokalise supports two popular multilingual plugins:

  • Polylang (only the free version is supported for now, but we’re working on adding support for the pro version)

In addition, the Lokalise WordPress plugin is compatible with the following:

Here’s a simplified overview of how the Lokalise WordPress plugin works:


Setting up the WordPress plugin

Before getting started, ensure you’ve installed either the WPML or Polylang plugin to enable multilingual content support on your WordPress site.

Once you’re ready, follow these steps:

  1. Install the Lokalise Companion Plugin

    • Open your WordPress admin dashboard and go to Plugins > Add New.

    • Enter "Lokalise" in the search box.

    • Click Install Now next to Lokalise Companion Plugin.

  2. Get the Authorization Secret Key

    • Once the plugin is installed, go to Settings > Lokalise.

    • Copy the Authorization secret key.

  3. Set up the Lokalise WordPress App

    • Head over to your Lokalise project and go to Apps > WordPress.

    • Click Install.

    • Enter your WordPress site hostname (e.g., https://example.com/wp-json) and paste the Lokalise secret key from step 2.

  4. Hosting Provider Considerations

    • If you use WP Engine, include the subdomain provided by WP Engine and use the HTTP protocol in the site hostname (e.g., http://yourcompany.wpengine.com/wp-json).

    • If you use Kinsta, try connecting with both http:// and https://. Due to Kinsta’s unique web stack and proxy setup, the protocol might vary for authentication.

  5. Authorize Lokalise

    • Click Authorize and then Accept to finalize the connection.

Custom login pages support

The Lokalise Companion Plugin works with custom login pages too. These pages let you use your own logo, background, and design for login screens. Popular plugins for creating custom pages include:

WordPress multisite

The Lokalise plugin supports WordPress Multisite, allowing you to translate multiple sites within a single WordPress network. However, note that the plugin must be activated on all sites you wish to translate. Currently, it’s not possible to translate separate locale subsites within a single Lokalise project.

Custom post types

WordPress comes with two basic post types by default: Posts and Pages. But many sites use custom post types like Tours, Articles, or Books.

The Lokalise plugin supports custom post types, but they must be marked as translatable first.

If you’re using WPML:

  • Go to WPML > Settings in your WordPress admin dashboard.

  • Scroll to the Post Types Translation section.

  • Set your custom post types to Translatable (only show translated items).

For more details, refer to the WPML documentation.

If you’re using Polylang:

  1. Go to Languages > Settings in your WordPress admin dashboard.

  2. Find the Custom post types and taxonomies section.

  3. Enable the custom post types you want to translate.

For more info, refer to the Polylang documentation.

Once your custom post types are set as translatable, they’ll have language attributes and will be ready for translation through Lokalise.

Advanced Custom Fields

Advanced Custom Fields (ACF) is a WordPress plugin that lets you add extra content fields to your WordPress edit screens.

Supported field types for translation include:

  • Text

  • Text Area

  • Wysiwyg Text

You can select these fields on the Lokalise integration page and import them into your Lokalise project. After adding translations, export these fields back to WordPress, and they’ll appear in the translated versions of your content.


Importing posts and pages

The Lokalise WordPress plugin supports automated imports, making it easy to pull content from your WordPress site into Lokalise. For more details, check out the Automated import/export article.

Once the plugin is set up, you’ll see a list of your existing WordPress content in the Lokalise app.

To start translating this content, follow these steps:

  • Select the content to import
    Importing means downloading the content from WordPress and creating new translation keys in Lokalise, which are then linked to the corresponding WordPress items.

  • Use the search and filter options
    If you need to find a specific post or page, use the Search box in the top right corner. To narrow down the list, use the Filter dropdown.

  • Choose items to import
    Tick the checkboxes next to the posts or pages you want to bring into Lokalise. Any languages that exist in WordPress but are missing in your Lokalise project will be automatically created during this process.

  • Start the import
    Click Import selected. The import will run in the background, and you can monitor its status on the Activity page.

Once the process is complete, your WordPress content will be ready for translation in Lokalise.


Translating content

Once your items are linked to Lokalise, head over to the project editor to start translating the content as usual. Any translations imported from WordPress will be tagged to help you easily identify them.

Imported content can have the following tags:

  • WordPress: Automatically applied to all content pulled from WordPress.

  • Title-based tags: You can create tags named after individual posts or pages by adding the Title attribute to the Assign tags list during import. For example, if the key is linked to the "Hello world" post, it will have a tag named "Hello world".


Managing imported items

The Lokalise WordPress plugin supports automated exports, allowing you to easily send your translations back to WordPress. For more detailed information, check out the Automated import/export article.

Open Wordpress app on Lokalise again to manage the currently imported items or import the new ones. You will see the list of all previously loaded items.

Exporting translations to WordPress

  • Go to the Apps page in your Lokalise project and open the WordPress app to view and manage your imported items.

  • You’ll see a list of all previously imported items. Choose the ones you want to upload back to WordPress by ticking the checkboxes next to them.

  • Click Export selected.

  • Select one or more languages to export.

    • If you want to include empty translations, uncheck the Don’t export empty translations option.

  • The export process will run in the background. Once complete, head over to your WordPress dashboard to verify that the selected items have been updated.

That’s it! Your translated content should now be live on your WordPress site.


Known issues

Note for Apache users

If you’re using the Apache web server, you may need to adjust your VirtualHost configuration to ensure the authorization flow works correctly. Although this step is usually not required, add the following line at the very beginning of your configuration:

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

After adding this line, restart your server.

Compatibility with other WordPress plugins and limitations

The Lokalise WordPress plugin may encounter issues when used alongside certain third-party plugins, especially drag-and-drop site builders like WPBakery.

  • Gutenberg reusable blocks: Currently unsupported. Convert these to regular blocks to properly import the content into Lokalise.

  • Unsupported content types:

    • Taxonomies

    • SEO metadata

    • Media files

Note for users with firewall or security restrictions

If you’re using a firewall, IP restrictions, or security plugins to protect your /wp-admin pages, make sure to whitelist Lokalise origin IP addresses. These can be found in the relevant article. Revisit this list periodically, as we update our IP addresses from time to time.

Troubleshooting tips

If you run into issues, check the following:

  1. Verify API endpoints
    Make sure you can access the following URL:
    yourwebsite.com/wp-json/lokalise/v1/environment.

  2. Ensure WPML is active
    Confirm that the WPML plugin is enabled and set as your localization provider by visiting the environment URL mentioned above.

  3. Update your permalink settings
    The default permalink structure can cause issues with the WordPress REST API. To change it:

    • Go to Settings > Permalinks.

    • Select anything but the “Plain” option.

  4. Check API data retrieval
    Visit yourwebsite.com/wp-json/wp/v2/pages and ensure that the content and excerpts fields are not empty.

  5. Retrieve locale list
    Open yourwebsite.com/wp-json/lokalise/v1/locales to check if the language names and codes are populated correctly (i.e., not empty or set to NULL).

If all these settings are correct and the issue persists, contact our support.

Did this answer your question?