- Statut
- Ouvert
- Extension/thème associé
- Rank Math SEO
- Étiquettes de sujet
- Compatibility
Aperçu de l’anomalie
Lorsque vous utilisez Rank Math SEO avec WPML, le contenu du shortcode d’extrait enrichi Rank Math [rank_math_rich_snippet id="..."] ne sera pas traduit.
Solution de contournement
Étape 1 : Rendez les champs traduisibles
- Allez dans « WPML > Paramètres > Configuration XML personnalisée ».
- Ajoutez ce qui suit et cliquez sur « Enregistrer ».
<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> - Apportez une petite modification à la page d’origine et enregistrez.
- Traduisez la page.
Étape 2 : Ajustez le shortcode ou utilisez le bloc Rank Math
- Le shortcode
[rank_math_rich_snippet id="..."]inclut un ID unique. - Utilisez plutôt le shortcode
[rank_math_rich_snippet](sans l’attribut id). - Vous pouvez également utiliser le bloc Schema by RankMath.