- ステータス
- 未解決
- 関連するプラグイン/テーマ
- Rank Math SEO
- トピックタグ
- Compatibility
問題の概要
WPMLでRank Math SEOを使用する場合、Rank Mathのリッチスニペットショートコード[rank_math_rich_snippet id="..."]のコンテンツは翻訳されません。
回避策
ステップ1: フィールドの翻訳可能化
- 「WPML」>「設定」>「カスタム XML 設定」に移動します。
- 以下を追加し、「保存」をクリックします。
<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> - 元のページに少し変更を加えて保存します。
- ページを翻訳します。
ステップ2: ショートコードの調整またはRank Mathブロックの使用
- ショートコード
[rank_math_rich_snippet id="..."]には一意のIDが含まれています。 - 代わりに(id属性のない)
[rank_math_rich_snippet]ショートコードを使用します。 - または、Schema by RankMathブロックを使用します。