Overview of the Issue
When using Rank Math SEO with WPML, the content of the Rank Math rich snippet shortcode [rank_math_rich_snippet id="...-2"] will not be translated.
Workaround
This issue is fixed in Rank Math SEO 1.0.279. Updating solves it on your site, so you only need this workaround if you can’t update yet.
Rank Math 1.0.279 and later translate the schema values. We still recommend the setup below: without it, WPML also sends technical schema values for translation, and translating those breaks the page’s structured data.
Step 1: Make the Fields Translatable
- Go to ”WPMLSettingsCustom XML Configuration“.
- Add the following and click “Save”.
<wpml-config> <custom-fields> <custom-field action="translate">rank_math_schema_HowTo</custom-field> <custom-field action="translate">rank_math_schema_Article</custom-field> <custom-field action="translate">rank_math_schema_SoftwareApplication</custom-field> </custom-fields> <custom-fields-texts> <key name="rank_math_schema_HowTo"> <key name="name" /> <key name="description" /> </key> <key name="rank_math_schema_SoftwareApplication"> <key name="headline" /> <key name="description" /> <key name="review"> <key name="negativeNotes"> <key name="itemListElement"> <key name="*"> <key name="name" /> </key> </key> </key> <key name="positiveNotes"> <key name="itemListElement"> <key name="*"> <key name="name" /> </key> </key> </key> </key> </key> <key name="rank_math_schema_Article"> <key name="headline" /> <key name="description" /> </key> </custom-fields-texts> </wpml-config> - Do a small modification to the original page and save.
- Translate the page.
Step 2: Adjust the Shortcode or Use the Rank Math Block
- The shortcode
[rank_math_rich_snippet id="...-3"]includes a unique ID. - Use
[rank_math_rich_snippet]shortcode instead (without the id attribute). - Alternatively, use the Schema by RankMath block.
Still Seeing This Issue?
If updating doesn’t fix it, ask a support question and we’ll look into it with you.
Ask a support question