- ステータス
- 解決済み
- 報告対象
- WPML SEO 2.1.0
- 解決されたバージョン
- WPML SEO 2.2.0
- トピックタグ
- Compatibility
問題の概要
言語ごとに異なるドメインを設定したWordPress多言語サイトでDiviテーマを使用している場合、Yoast SEOのサイトマップに誤ったドメインが表示されることがあります。
回避策
作業を進める前に、必ずサイトの完全なバックアップを作成してください。
- …/wp-content/plugins/wp-seo-multilingual/classes/class-wpml-wpseo-xml-sitemaps-filter.phpファイルを開きます。
- 77行目を見つけます。
- 次のコードを:
add_filter( 'wpseo_enable_xml_sitemap_transient_caching', [ $this, 'transient_cache_filter' ], 10, 0 );
- 次のように変更します:
add_filter( 'wpseo_enable_xml_sitemap_transient_caching', [ $this, 'transient_cache_filter' ], PHP_INT_MAX, 0 );