WPML

Getting Started

To translate Rank Math with WPML, you need the following plugins:

Translate On-Page SEO Attributes

WPML can translate all on-page SEO attributes. This includes:

  • Page titles
  • Meta descriptions
  • Breadcrumbs
  • Image ALT and captions
  • Permalinks
  • And more…

Rank Math’s Strip Category Base option and the Remove base and Remove category base options in its WooCommerce settings work with WPML. A removed base no longer appears in your URLs, so WPML SEO turns off slug translation for it. With Rank Math’s Remove parent slugs option, product category links keep their translated base.

One limit remains with the Remove base option for products: WPML can’t recognize a link to a product in your content, so links in translated content keep pointing to the original product. Read about the workaround for links when you strip the product base.

To translate on-page SEO attributes with WPML, simply send your content for translation. WPML translates attributes along with the page or post they’re associated with.

Translating post with Rank Math SEO attributes
Translating post with Rank Math SEO attributes

Translate Taxonomy Metadata

When translating a post, WPML also translates attached taxonomies. This includes any SEO attributes you added in Rank Math’s snippet for each taxonomy term (like meta title and meta description).

Adding a category’s meta title and meta description with Rank Math
Adding a category’s meta title and meta description with Rank Math

If you modify a taxonomy’s metadata in the original language — or want to translate taxonomies that aren’t attached to any post — go to WPMLTranslationsTaxonomy to update translations.

Translating taxonomy terms and metadata with WPML Taxonomy Translation
Translating taxonomy terms and metadata with WPML Taxonomy Translation

Translate Global SEO Texts

To translate global SEO texts, like the breadcrumbs’ homepage label, follow these steps:

  1. Go to WPMLTranslations.
  2. Scroll down to the Other texts (Strings) section and search for your texts.
  3. Select your texts and send them for translation.

Multilingual Sitemaps With WPML

WPML handles multilingual sitemaps and hreflang tags automatically. When Rank Math’s Sitemap module is on, WPML SEO adds hreflang tags for every translation to the XML sitemaps. When WPML SEO first runs with the module on, it turns off the hreflang tags in the page <head>, so search engines don’t get the same tags twice. If you turn off the Sitemap module, WPML SEO turns the hreflang tags in the page <head> back on. If you turn the module on later, turn off the hreflang tags in the page <head> yourself, with the setting in step 2 below.

Adding hreflang tags in the page <head>

If you’d like hreflang tags in the page <head> instead of the sitemap, you can change the setting yourself. Just:

1. Stop WPML from adding the hreflang tags to your sitemap, by adding this line to your wp-config.php:

PHP
define( 'WPML_SEO_ENABLE_SITEMAP_HREFLANG', false );

2. Navigate to the WPMLSettingsURLs and SEO page and look for the SEO Options section. You’ll see the checkbox Display alternative languages in the HEAD section — enable it and Save.

Enabling the option to add hreflang tags in the page <head>
Enabling the option to add hreflang tags in the page <head>

If your site has no hreflang tags in the sitemap or in the page <head>, use the same setting to turn the hreflang tags in the page <head> back on.

Pages That Show the Original Content

If a post type uses the Display as translated option, a page with no translation shows the original content in the secondary language. Search engines treat this page as a duplicate of the original, so the XML sitemaps don’t list it. The HTML sitemap that Rank Math’s [rank_math_html_sitemap] shortcode displays still lists it, because that page is for visitors.

Translate Rank Math With WPML 

If you already have a WPML account, you can download the WPML SEO add-on for Rank Math (at no additional cost) from the Downloads page.

Don’t have WPML? Visit our pricing page to find the right plan for your website. 

Written byAmir