WordPress

The Transifex Live Translation Plugin makes it easy to translate your WordPress site. It uses Transifex Live, a JavaScript-based approach to website translation which allows you to translate your web content in context without complicated processes or workflows.

With the plugin, you'll be able to:

Add the Transifex Live JavaScript snippet to your site without editing any code files. This snippet is necessary in order to show translations to your visitors.

Create language/region-specific URLS subdirectories (e.g. <a href="http://www.example.com/fr/">www.example.com/fr/</a>) or map existing language subdomains (e.g. fr.example.com) to the plugin. In both cases, the languages published via Transifex are seamlessly made available to your visitors.

Add HREFLANG tags to your web pages. These tags tell search engines which languages your site is available in.

Be sure you've signed up for a Transifex account. Then after creating an organization, head to your Transifex Dashboard and hit the Add project button. Fill in your project details, and when prompted to choose a project type, pick "Web Project" and add the URL of your site.

If this is your first project in Transifex, we recommend choosing your project's target languages when creating the project, rather than adding them later.

After creating your project, you'll be redirected back to the Transifex Dashboard. Your new project will be pre-selected. You'll also see that your project now has one resource, which is simply a container for your source content and translations.

Look for the Live button near the top right and click on it.

Your site will load in Transifex Live and you'll be able to start saving and translating your content. For more information how to use Transifex Live, check out our Transifex Live documentation.

Go back to WordPress and head to Settings > Transifex Live and add the Transifex Live API key you copied earlier.

Hit Save to save your API key to WordPress.

If you only want to use the plugin for adding the Transifex Live JavaScript snippet to your site, then you can click the 'Start Translating NOW' button to start using the Transifex sidebar right away. Otherwise, read on

The Transifex Live Translation Plugin includes options that can make your site more SEO-friendly, in turn helping your site rank in global search engines.

With the plugin, you're able to set language or region-specific URLs for your site (we'll refer to them as regional URLs going forward to keep things simple). This is done by creating new language subdirectories through the plugin, or by pointing to existing language subdomains.

Note

If you plan to enable regional URLs, we strongly recommend disabling the language picker.

Disabled

This is the default mode and regional URLs are disabled. The plugin will only add the Transifex Live JavaScript snippet to your WordPress site. All Transifex Live options – including the default language picker – are enabled and can be controlled from Transifex Live settings.

Subdirectories

In this mode, the plugin will enable regional URLs and create language subdirectories in your site. If your English site's home page URL is http://www.example.com/, your French site's home page URL would be www.example.com/fr/. Note that you can only use languages that have been first published from Transifex Live.

For each language, you can set the name of the subdirectory. What you set will always appear immediately after your domain, so if you use fr for your French pages, the URL for the French version of your Product page will look something like www.example.com/fr/product/. If you recently published or unpublished a language in Transifex Live and it's not in the list, hit the Refresh Languages List button.

Heads up!

The plugin creates new sets of URLs when you enable the Subdirectory option. For example, if you have 10 English pages and publish 3 other languages using Transifex Live, your site will have a total of 40 URLs after turning on regional URLs. Proceed with caution!

After enabling the Subdirectory mode, you can specify which types of content will use the localized URL structure. So if you only want to use it with pages and not posts, you have that option.

Subdomains

In this mode, the plugin will attempt to match the published languages of Transifex Live to a set of language subdomains you specify. If you already have existing language subdomains set up (this has to be done outside of the plugin), you can enter the language subdomain names in the plugin. So if fr.example.com is the subdomain for your French site, put in fr. It is important that you set up the subdomains to match the languages that are published via Transifex Live.

Hreflang tag

When you enable subdirectory or subdomain mode, the plugin will automatically add hreflang tags to the of your site. The hreflang tag tells search engines that a page of your website exists in another language, allowing search engines to show the correct language-specific URL to users who search in that language. This helps to avoid any duplicate content penalties so your website can rank in international SERPs. To read more about the hreflang tag, see Google's Search Console Help Center. The Hreflang code is automatically set based on the language code used by Transifex, however it can be overriden by changing the value in the associated Hreflang textbox.

Transifex Live uses JavaScript to serve translations to end users. However, bots (think search engines crawlers and social media sites) can't always handle websites with JavaScript. To address this, we've added support for Prerender in our WordPress plugin.

First, what's Prerender?

Put simply, it's an Open Source tool that renders your site (including the JavaScript) and serves the pages to the bots.

By using the Transifex Live WordPress plugin together with Prerender, search engines will be able to crawl and index your translated pages. And when people share a page from your translated site on Facebook, for example, the preview will be translated as well.

By default, Transifex shows a language picker at the bottom left corner of your site after you've publish translations. If the subdirectory or subdomain option is enabled in the plugin, your visitors will be redirected to the regional URL whenever they switch between languages.

You can customize the language picker. You also have the option to disable it all together. To do this, go to the Transifex Live and click Settings at the bottom. Then in the language picker position dropdown, select Do not place a picker and hit Save.

Refreshing WordPress URLs can be tricky! One way to make sure WordPress is using the latest URLs is to simply visit the Permalinks page in the WordPress settings. You don't need to update or change anything on this page for a refresh to occur.

Keep in mind that your WordPress URL must match the one that the site is published under in Transifex Live. Optionally, in Transifex Live you can have two URLs set up – one for production and a second for staging. Each of these would require a separate WordPress environment.

Make sure your WordPress site is using a fully qualified public domain name and that your site is accessible from external Transifex servers.