Google Search Consoleでサイトマップが登録できない

仕事のこと

Google Search Consoleからサイトマップを送信すると登録は完了しますが、「取得できませんでした」とエラーが発生する場合があります。
「取得できませんでした」エラーが発生する原因と対処法をご紹介します。

‘X-Robots-Tag’ http ヘッダーで ‘noindex’ が検出されました

wp-content/plugins/google-sitemap-generator/sitemap-core.php
の中で、

if(!headers_sent()) header(‘X-Robots-Tag: noindex’, true, 200);

if(!headers_sent()) header(‘X-Robots-Tag: index’, true, 200);

に変更