WordPress provides a powerful taxonomy system, including post categories and tags. Users can also define custom taxonomies like product attributes in e-commerce sites. WPML makes it easy to translate all these taxonomies.
In this article, we’ll translate product categories as an example, but any taxonomy registered with WordPress has a similar interface. You can translate taxonomy terms individually, from the taxonomy edit screens, or centrally from WPML → Taxonomy Translation.
- Enabling Taxonomy Translation in Settings
- Translating Taxonomies
- Synchronizing Hierarchical Taxonomies
You can translate two aspects of your taxonomies: the terms themselves and the base slugs. You need to enable both of these in your settings before you can translate them.
Go to the WPML → Settings page and scroll to the Taxonomies Translation section. Set your custom taxonomy to Translate. Note that you can also set the Translate option to show only translated items on the front-end or to use translation if available or fallback to the default language.
Go to the WPML → Settings page and scroll to the Slug translations section. Make sure the checkbox to translate custom post and taxonomy base slugs is selected.
WPML offers five ways for translating your taxonomies, depending on your preferred workflow.
When you use the Advanced Translation Editor to translate a post or page, any taxonomy terms assigned to that content will also be available for translation.
Simply translate the page or post as normal, or click the Translate automatically button to translate the page’s content and taxonomy using automatic translation.
WPML provides a central interface for translating all categories, tags, and custom taxonomies on your site.
Go to the WPML → Taxonomy Translation page and use the drop-down menu to select which taxonomy to translate.
Once selected, you can translate the taxonomy’s terms and slugs.
As you apply these taxonomy terms to content, the translated content will be associated with the corresponding translated taxonomy.
WordPress allows you to save meta values for terms in a similar way to post metadata. In other words, taxonomy terms can feature custom fields that can also be easily translated while translating the terms. You can set your taxonomy term meta as translatable by going to WPML → Settings and scrolling to the Custom Term Meta Translation section.
You can add or edit taxonomy terms by going to Posts → Categories or Posts → Tags. You can translate your taxonomy terms here as well. In this example, we will translate a category for a site that lists books.
- Go to Posts → Categories and choose the term you want to translate. In our case, it’s Poetry.
- Scroll down to the Language meta box and click to add a translation in your secondary language.
- This opens the Categories page again, but with French selected in the language switcher. You can also see a message, Adding a translation for: Poetry.
- Add the name and slug in French and click Add New Category.
When you click to edit the term in the secondary language, you can now see which term it’s a translation of in the dropdown menu.
In the default language, you can see which languages you have translated a term into and their translations.
If your site has a lot of taxonomy terms, it might be inconvenient to translate them one by one. WPML provides you with an easy way to translate all your taxonomy terms at once and translate your terms instantly using automatic translation.
You can also assign taxonomy like categories, tags, and attributes to your WooCommerce products. You can translate these terms using WPML and WooCommerce Multilingual. Please see our documentation about WooCommerce Multilingual for more details on translating your product taxonomies.
As a site grows there may be times when there is a need for the taxonomy hierarchy to change to accommodate the new content. Site admins usually make hierarchy changes to the taxonomy tree in one language and want the other languages to adjust automatically.
On the Taxonomy Translation page, click the Hierarchy Synchronization tab.
The tab displays taxonomy terms for synchronization when there is something to synchronize. Otherwise, it will display a message informing you that the taxonomy hierarchy is already synchronized.