Sitemap ошибка 404

Is your sitemap giving a 404 error? This article will take you through the steps you should follow to fix this error. First of all, we’d like to inform you that this is usually not due to our plugin, but due to poorly coded themes and/or other plugins. A 404 error basically means that the sitemap index or individual sitemap does not exist for a variety of reasons. 

You can solve the 404 error by following the steps below.

  • 1. Update the permalink structure
  • 2. No content for the sitemap
  • 3. Rewrite rules are missing
    • Using Apache server
    • Using NGINX server
  • 4. Check to see if sitemaps have been enabled

1. Update the permalink structure

First of all, sometimes resetting the permalink structure will quickly solve a 404 error from a recent change to your installation. Go to Admin > Settings > Permalinks and click save without altering anything. For more, information, see this how-to guide.

2. No content for the sitemap

Second, check that items exist in order to create the individual sitemap. For example, a category sitemap requires categories with published content. If the items do not exist, exclude the post type or taxonomy from the sitemap until you create content. For more information, see this how-to guide.

3. Rewrite rules are missing

If you still receive a 404, check the rewrite rules for your server. If you are not sure how to check for the rules below, which server you are using, or how to enter them, please contact your host provider.

Using Apache server

This article has more advice on troubleshooting the sitemaps on Apache servers: Yoast XML Sitemaps on Apache servers.

Using NGINX server

This article has more advice on troubleshooting the sitemaps on NGINX servers: Yoast XML Sitemaps on NGINX servers.

4. Check to see if sitemaps have been enabled

Finally, make sure to check if you have enabled sitemaps in Yoast SEO.

Related articles

As of Yoast SEO 20.0, the settings interface inside our plugins has received a major overhaul. Please update to the latest version of Yoast SEO if your plugin does not look like the screenshots you encounter in our Help center.

Is your sitemap giving a 404 error? This article will take you through the steps you should follow to fix this error. First of all, we’d like to inform you that this is usually not due to our plugin, but due to poorly coded themes and/or other plugins. A 404 error basically means that the sitemap index or individual sitemap does not exist for a variety of reasons. 

You can solve the 404 error by following the steps below.

  • 1. Update the permalink structure
  • 2. No content for the sitemap
  • 3. Rewrite rules are missing
    • Using Apache server
    • Using NGINX server
  • 4. Check to see if sitemaps have been enabled

1. Update the permalink structure

First of all, sometimes resetting the permalink structure will quickly solve a 404 error from a recent change to your installation. Go to Admin > Settings > Permalinks and click save without altering anything. For more, information, see this how-to guide.

2. No content for the sitemap

Second, check that items exist in order to create the individual sitemap. For example, a category sitemap requires categories with published content. If the items do not exist, exclude the post type or taxonomy from the sitemap until you create content. For more information, see this how-to guide.

3. Rewrite rules are missing

If you still receive a 404, check the rewrite rules for your server. If you are not sure how to check for the rules below, which server you are using, or how to enter them, please contact your host provider.

Using Apache server

This article has more advice on troubleshooting the sitemaps on Apache servers: Yoast XML Sitemaps on Apache servers.

Using NGINX server

This article has more advice on troubleshooting the sitemaps on NGINX servers: Yoast XML Sitemaps on NGINX servers.

4. Check to see if sitemaps have been enabled

Finally, make sure to check if you have enabled sitemaps in Yoast SEO.

Related articles

Плагин Yoast WordPress SEO является одним из самых популярных и популярных плагинов SEO для WordPress. Помимо возможности добавления настраиваемого метаописания, заголовка и других оптимизаций на странице, он также предлагает множество других дополнительных функций. Некоторые из дополнительных функций, такие как добавление хлебных крошек, перенаправление изображений вложений для публикации, XML-карта сайта, проверка инструментов веб-мастеров и т. Д., Помогают пользователям использовать один плагин для всех целей SEO. К сожалению, функция XML Sitemap может создать некоторые проблемы для вашего сайта WordPress. В этой статье давайте рассмотрим возможные проблемы с XML Sitemap с плагином Yoast WordPress SEO.

Включение XML Sitemap в плагине Yoast SEO

После установки и активации плагина перейдите в меню «SEO> XML Sitemaps», чтобы увидеть текущий статус Sitemap. Перед тем, как читать «Вы можете найти свой XML-файл Sitemap здесь, убедитесь, что установлен статус« Включено »и есть кнопка« XML Sitemap »с текстом:»

Включить XML Sitemap в плагине Yoast WordPress SEO

Включить XML Sitemap в плагине Yoast WordPress SEO

Если Sitemap отключен, кнопка «XML Sitemap» автоматически исчезнет.

Возможные ошибки карты сайта с плагином Yoast WordPress SEO

Ниже приведены возможные ошибки, связанные с XML Sitemap, на основе нашего опыта:

  • Карта сайта вообще не работает
  • Ошибка 404 Страница не найдена
  • внутренняя ошибка сервера 500
  • xml не перенаправляет на sitemap_index.xml
  • Пользовательские записи / категории Sitemap не найдены
  • Автор / дата перенаправление архивов на домашнюю страницу

Возможные исправления описаны в следующих разделах.

1. Карта сайта вообще не работает

Если вы видите, что файл Sitemap не открывается или отображается белая страница, попробуйте следующее:

  • Отключите XML Sitemap в плагине Yoast.
  • Перейдите в «Настройки»> «Постоянные ссылки» и сохраните изменения.
  • Включите XML Sitemap в плагине Yoast снова.

Иногда также может помочь изменение структуры постоянных ссылок и ее сброс.

2. Ошибка 404 «Страница не найдена»

Если XML-карта сайта указывает на ошибку 404 Page Not Found, Yoast рекомендует добавить фрагмент кода для решения проблемы. В самом плагине Yoast SEO есть возможность изменить файл .htaccess в разделе «SEO> Инструменты> Редактор файлов».

Для серверов Apache с установленным WordPress в «/ public_html» добавьте приведенный ниже код до начала перезаписи постоянных ссылок WordPress.

# Start Yoast SEO - Sitemap Fix for Normal WordPress Install
RewriteEngine On
RewriteBase /
RewriteRule ^sitemap_index.xml$ /index.php?sitemap=1 [L]
RewriteRule ^locations.kml$ /index.php?sitemap=wpseo_local_kml [L]
RewriteRule ^geo_sitemap.xml$ /index.php?sitemap=geo [L]
RewriteRule ^([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 [L]
RewriteRule ^([a-z]+)?-?sitemap.xsl$ /index.php?xsl=$1 [L]
# END Yoast SEO - Sitemap Fix for Normal WordPress Install

Если у вас установлен WordPress в подпапке, добавьте приведенный ниже код в файл .htaccess. Подкаталог в этом примере — «wordpress», который вы можете изменить на собственное имя подкаталога.

# Start Yoast SEO - Sitemap Fix for Subdirectory WordPress Install
RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^sitemap_index.xml$ /wordpress/index.php?sitemap=1 [L]
RewriteRule ^locations.kml$ /wordpress/index.php?sitemap=wpseo_local_kml [L]
RewriteRule ^geo_sitemap.xml$ /wordpress/index.php?sitemap=wpseo_local [L]
RewriteRule ^([^/]+?)-sitemap([0-9]+)?.xml$ /wordpress/index.php?sitemap=$1&sitemap_n=$2 [L]
# END Yoast SEO - Sitemap Fix for Subdirectory WordPress Install

Если вы используете сервер Nginx, добавьте приведенный ниже код в файл конфигурации сервера Nginx:

# Yoast Sitemap Fix
location ~ ([^/]*)sitemap(.*).x(m|s)l$ {
## this redirects sitemap.xml to /sitemap_index.xml
rewrite ^/sitemap.xml$ /sitemap_index.xml permanent;
## this makes the XML sitemaps work
rewrite ^/([a-z]+)?-?sitemap.xsl$ /index.php?xsl=$1 last;
rewrite ^/sitemap_index.xml$ /index.php?sitemap=1 last;
rewrite ^/([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
## The following lines are optional for the premium extensions
## News SEO
rewrite ^/news-sitemap.xml$ /index.php?sitemap=wpseo_news last;
## Local SEO
rewrite ^/locations.kml$ /index.php?sitemap=wpseo_local_kml last;
rewrite ^/geo-sitemap.xml$ /index.php?sitemap=wpseo_local last;
## Video SEO
rewrite ^/video-sitemap.xsl$ /index.php?xsl=video last;
}

3. 500 Внутренняя ошибка сервера

Ошибка внутреннего сервера 500 может произойти либо при нажатии на файл «sitemap_index.xml», либо при нажатии на отдельную часть файла Sitemap в файле индекса, например «post-sitemap.xml». В большинстве сценариев это связано с ограничением времени выполнения сценария PHP на уровне хоста. Чтобы сократить время выполнения, вы можете уменьшить количество записей в каждом файле Sitemap. По умолчанию количество записей в каждом файле Sitemap ограничено 1000 в плагине Yoast WordPress SEO. Но 1000 также вызывает внутреннюю ошибку сервера в большинстве сред общего хостинга, таких как Bluehost.

Уменьшить количество записей в файлах Sitemap

Уменьшить количество записей в файлах Sitemap

Так что уменьшите макс. записей на файл Sitemap до 300 или 400 и проверьте, что все файлы Sitemap доступны в индексе Sitemap. При изменении количества записей все отдельные файлы Sitemap, такие как сообщения, теги и категории, будут соответствующим образом реструктурированы. Следовательно, настоятельно рекомендуется повторно отправить ваш Sitemap в Google и другие поисковые системы после завершения количества записей.

4. Sitemap.xml не перенаправляет на Sitemap_index.xml

К файлу Sitemap по умолчанию для сайта WordPress можно получить доступ по URL-адресу «http://yoursite.com/sitemap.xml». Но плагин Yoast не создает файл sitemap.xml, а динамически создает файл индекса Sitemap. Доступ к индексному файлу можно получить по URL-адресу «http://yoursite.com/sitemap_index.xml». Файл индекса Sitemap содержит все отдельные файлы Sitemap, как показано в следующем примере:

Пример файла индекса Sitemap XML Yoast

Пример файла индекса Sitemap XML Yoast

Обычно «sitemap.xml» автоматически перенаправляет на «sitemap_index.xml». Но в некоторых случаях файл Sitemap не выполняет перенаправление, и для этой цели необходимо добавить перенаправление вручную. Добавьте приведенный ниже код в файл .htaccess.

Redirect 301 /sitemap.xml /sitemap_index.xml

Вы также можете добавить перенаправление с помощью плагинов, таких как перенаправление, непосредственно из панели администратора WordPress или через свою учетную запись хостинга. Если вы используете сервер Nginx, обратитесь к разделу 2 выше, чтобы исправить ошибку 404 page not found, которая также имеет перенаправление с sitemap.xml на sitemap_index.xml.

5. Файлы Sitemap для настраиваемых сообщений или категорий не найдены

Когда вы используете пользовательские сообщения / категории / теги, плагин Yoast SEO имеет настройку для включения или отключения соответствующих файлов Sitemap. Перейдите к «SEO> XML-карты сайта» и проверьте на вкладках «Типы сообщений» и «Таксономии», чтобы включить или отключить необходимые карты сайта. Например, у нас есть настраиваемая таксономия с именем «Категории часто задаваемых вопросов», отключение которой приведет к удалению соответствующего файла Sitemap из файла индекса.

Включение или отключение настраиваемых файлов Sitemap

Включение или отключение настраиваемых файлов Sitemap

6. Перенаправление архива автора или даты на домашнюю страницу

Когда один автор управляет всем блогом, нет необходимости в отдельном архиве авторов Sitemap. Это сделано для того, чтобы избежать дублирования контента под двумя разными URL-адресами страницы архива автора, а также на странице индекса блога. Точно так же для блога с одним автором весь архив дат, архив авторов и страница индекса блога будут иметь одинаковое содержание.

Когда вы отключили архивы авторов и архивы на основе даты в разделе «SEO> Название и мета», эти архивные страницы будут перенаправляться на вашу домашнюю страницу. Проверьте настройки и включите или отключите архивы в соответствии с вашими потребностями.

Перенаправить архивы автора и даты на домашнюю страницу

Перенаправить архивы автора и даты на домашнюю страницу

Будучи загружен более 1 миллиона раз, плагин WordPress SEO плагин на сегодняшний день является лучшим и наиболее полным SEO плагином для WordPress. В то время как он не дал нам никаких проблем в прошлом, для некоторых пользователей это была боль. Недавно один из наших клиентов столкнулся с вопросом о получении ошибки 404 для своих карт сайта порожденных плагином WordPress SEO от Yoast. После нескольких попыток, нам удалось выяснить решение. В этой статье мы покажем вам, как исправить ошибку 404 в карте сайта плагина WordPress SEO от Yoast.

ВАЖНО!

Очень важно, чтобы вы поняли, что эта проблема, скорее всего, вызвана плохо кодированной функцией темы или плагина. плагин Йоаст прекрасно работает на наших сайтах. Просто хотел быть очень ясно говорит об этом.

Первое, что вы должны сделать, это открыть файл .htaccess (вы можете сделать это с помощью плагина WordPress SEO > Возможность редактирования файлов) и просто добавьте следующий код там:

# WordPress SEO - XML Sitemap исправление
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^sitemap_index.xml$ /index.php?sitemap=1 [L]
RewriteRule ^([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 [L]
</IfModule>
# конец WordPress SEO - XML Sitemap исправление

Для большинства людей это исправило проблему. Кто-то сообщил, что в то время как этот код фиксируется проблему, страница все еще посылала заголовок ответа 404, что означало, что инструмент Google Вебмастера не мог найти её. Ну в случае нашего клиента, указанное решение не решило проблему.Как исправить ошибку 404 карты сайта в WordPress SEO Yoast

В то время как это не является предпочтительным, у нас не было выбора, кроме как изменить файлы ядра плагина, чтобы исправить эту проблему. Отредактировали class-sitemaps.php, расположенный в “/wp-content/plugins/wordpress-seo/inc/class-sitemaps.php”.

Вы должны смотреть на код функции init() и сделать этот раздел выглядеть следующим образом:

01/**
02     * Initialize sitemaps. Add sitemap rewrite rules and query var
03     */04    function init() {
05        global $wp_rewrite;
06        $GLOBALS['wp']->add_query_var( 'sitemap' );
07        $GLOBALS['wp']->add_query_var( 'sitemap_n' );
08        add_rewrite_rule( 'sitemap_index.xml$', 'index.php?sitemap=1', 'top' );
09        add_rewrite_rule( '([^/]+?)-sitemap([0-9]+)?.xml$','index.php?sitemap=$matches[1]&sitemap_n=$matches[2]', 'top' );
10        $wp_rewrite->flush_rules();
11    }

В основном то, что мы делаем, это добавляем глобальной $ wp_rewrite и добавление flush_rules после кода. При добавлении этого в плагин, это, кажется, должно исправить 404 на веб-сайте нашего клиента.Мы понятия не имеем, почему Yoast не делает это по умолчанию, Но мне кажется, что довольно много пользователей, имеющих эту проблему 404 сайта.

Обновление: Как некоторые из наших пользователей сообщили , что после применения исправления выше, они по- прежнему снимают флажок в карты сайта плагина SEO от Yoast и сохранить свои настройки. После этой повторной проверки вариант карты сайта ошибка для них была исправлена.

Если у Вас есть эта проблема, мы надеемся, что это исправление помогло вам.

Если вы нашли ошибку, пожалуйста, выделите фрагмент текста и нажмите Ctrl+Enter.

YOAST WordPress SEO — ошибка 404 в XML Sitemaps

На одном из своих блогов, решил поставить, это, сейчас популярный и на самом деле очень хороший плагин: WordPress SEO от Yoast Team. И Вы знаете, он на самом деле хорош! Да, может не такой понятный как All In One SEO Pack, но во многом лучше него. Допустим, он может убирать эту не нужную категорию /category/ или заменить её на что-то иное. Так же, очень круто, что он сам добавляет к названиям URL страниц расширение .html! И он сам создает xml sitemap, но вот тут у меня не все так радужно получилось.

Казалось бы, что проще, есть функция, есть кнопочка, жми её, заходи на страницу карты сайта и добавляй этот адрес в Google и Яндекс. Но! Как оказалось при переходе на страницу xml-sitemap она выдавала ошибку 404! Что за дела?

Обновлено! Читать перед редактированием!

В комментариях к данному посту, пользователь kamar87 предложил очень простой и как оказалось реально действующий способ избавиться от данной проблемы без каких либо редактирований файлов! Вот его дословная цитата:

Ещё рабочий вариант без всяких редактирований файла!
Поле того как поставили галочку на «Отметьте этот пункт, чтобы включить XML карту сайта.» — сохраняем настройки. Переходим Настройки-Постоянные ссылки и просто нажимаем сохранить. Все!

По дальнейшим отзывам, всё на самом деле так просто! Поэтому выражаем ему благодарность и дальше пост НЕ читаем ?

А для тех кто всё-таки хочет заморочиться, продолжим…

Как я понял, проблема как раз в конфликте карты сайта и настройки расширений .html

Как исправить ошибку 404 в sitemaps от YOAST SEO?

Первое что мы должны сделать, это зайти в наш .htaccess и добавить следующий код:

# WordPress SEO — XML Sitemap Rewrite Fix
RewriteEngine On
RewriteBase /
RewriteRule ^sitemap_index.xml$ /index.php?sitemap=1 [L]
RewriteRule ^locations.kml$ /index.php?sitemap=wpseo_local_kml [L]
RewriteRule ^geo_sitemap.xml$ /index.php?sitemap=geo [L]
RewriteRule ^([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 [L]
RewriteRule ^([a-z]+)?-?sitemap.xsl$ /index.php?xsl=$1 [L]
# END WordPress SEO — XML Sitemap Rewrite Fix

Обычно этого достаточно, но смотрите, зачастую первые строки уже есть в вашем .htaccess файле. Поэтому достаточно добавить строки:

RewriteRule ^sitemap_index.xml$ /index.php?sitemap=1 [L]
RewriteRule ^locations.kml$ /index.php?sitemap=wpseo_local_kml [L]
RewriteRule ^geo_sitemap.xml$ /index.php?sitemap=geo [L]
RewriteRule ^([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 [L]
RewriteRule ^([a-z]+)?-?sitemap.xsl$ /index.php?xsl=$1 [L]

К уже существующему коду. А если у вас там есть строка: /IfModule, то код должен быть перед ней.

Если же при изменении .htaccess файл sitemap так же выдает ошибку 404, то надо лезть в код самого плагина и добавить там пару строк.

Заходим в:
/wp-content/plugins/wordpress-seo/inc/class-sitemaps.php

и где-то на 80 строке, перед строками:

/**
* Class constructor
*/

Вставляем следующий код:

/**
* Initialize sitemaps. Add sitemap rewrite rules and query var
*/
function init() {
global $wp_rewrite;
$GLOBALS[‘wp’]->add_query_var( ‘sitemap’ );
$GLOBALS[‘wp’]->add_query_var( ‘sitemap_n’ );
add_rewrite_rule( ‘sitemap_index.xml$’, ‘index.php?sitemap=1’, ‘top’ );
add_rewrite_rule( ‘([^/]+?)-sitemap([0-9]+)?.xml$’, ‘index.php?sitemap=$matches[1]&sitemap_n=$matches[2]’, ‘top’ );
$wp_rewrite->flush_rules();
}

Теперь, всё точно должно заработать!

Ошибка 404 при открытии файла Sitemap XML в WordPress? Я покажу как это исправить. Но для этого у вас должен быть установлен и работать плагин Yoast SEO.

Ошибка 404 при открытии файла Sitemap XML в WordPress

Здравствуйте, друзья! Недавно в Яндекс вебмастере и в сервисе Google Search Console эти компании показали мне, что не видят файла Sitemap XML. Я конечно удивился. Каких-либо действий с данными файлами я не производил. Всё было нормально. Тогда я провёл анализ в одном из онлайн сервисов. И в результатах анализа также было сказано, что карта Sitemap не обнаружена.

Я попытался карту открыть и вот тут обнаружилась ошибка 404 при открытии файла Sitemap XML. Конечно это не критично. Сайт может существовать и индексироваться и без этой карты. Но лучше всё-таки с ней. Особенно если вы создали сайт для заработка. Я не буду здесь писать какую роль играет карта. Здесь только об исправлении ошибки.

Я потратил половину дня, чтобы понять, что мне нужно делать. Какой-нибудь статьи по этому поводу не нашёл. Поэтому пришлось лазить по многочисленным форумам. В результате ответ я всё-таки нашёл. И решил написать статью. Чтобы структурировать данную информацию.

Итак. Я рекомендую открыть консоль в двух вкладках. В первой вкладке заходим в настройки плагина Yoast SEO. Общие, далее вкладка возможности.

Ошибка 404 при открытии файла Sitemap XML

Листаем вниз. Нам нужен выключатель XML-карта сайта.

Ошибка 404 при открытии файла Sitemap XML в WordPress

Выключаем карту. Сохраняем настройки. Включаем карту. Сохраняем настройки. Таким образом мы эту карту как бы перезапустили. После этого идём в консоль во второй вкладке (можно всё делать в одной). Настройки, далее постоянные ссылки. И внизу нажимаем на кнопку «Сохранить изменения». Всё.

Возвращаемся в плагин Yoast SEO. Нажимаем на знак вопроса рядом с выключателем и открываем карту. Всё должно исправиться. У меня во всяком случае так и получилось.

Ошибка 404 при открытии файла Sitemap XML в WordPress

После этого необходимо в Яндекс вебмастере и в Google Search Console отправить эти файлы на переобход. Надеюсь, что если у вас возникнет ошибка 404 при открытии файла Sitemap XML, то данная статья вам поможет.

На этом у меня всё. Всем удачи и до встречи!

Are you trying to fix Yoast SEO’s sitemap 404 error in WordPress?

Yoast SEO is one of the most popular SEO plugins for WordPress. Due to a plugin conflict or incorrect WordPress settings, it may show a 404 error when you try to visit your XML sitemap.

In this article, we’ll show you how to easily fix the Yoast SEO XML sitemap 404 error in WordPress.

Fixing Yoast SEO XML sitemap 404 error in WordPress

What’s Causing Yoast SEO Sitemap 404 Error in WordPress?

WordPress comes with a default XML sitemap that you can submit to Google Search Console and other search engines.

This XML sitemap can be visited by entering the following URL in your browser’s address bar.

https://example.com/sitemap.xml

However, this default WordPress generated sitemap is very basic. To fix this, all top WordPress SEO plugins like All in One SEO for WordPress or the Yoast SEO plugin create their own XML sitemaps with more features.

When you use the XML sitemap generated by your WordPress SEO plugin, these plugins rewrite the default WordPress XML sitemap shortcut.

This means the sitemap URL mentioned above will now send users to the sitemaps generated by your WordPress SEO plugin.

Unfortunately, this may cause a 404 error on some websites due to plugin conflicts or incorrect WordPress settings.

That being said, let’s take a look at how to easily fix the WordPress sitemap 404 error in the Yoast SEO plugin.

1. Refresh WordPress Permalink Structure

WordPress comes with an SEO friendly URL structure (also called permalinks). This URL structure uses a redirect system to tell your web hosting server which page to load when a user enters a URL in their browser.

Normally, these permalinks settings are automatically updated when you make changes to your website.

However, sometimes WordPress may not be able to refresh the permalink structure which may cause Yoast SEO’s sitemap 404 error to appear.

This can be easily fixed by visiting the Settings » Permalinks page in the WordPress admin area and simply clicking on the Save changes button.

Update permalinks

Doing so will refresh the WordPress permalink settings. You can now visit your XML sitemap page to see if this fixed your problem.

If it didn’t fix the problem, then you can continue reading.

2. Manually Update Permalinks

If refreshing your WordPress permalink structure doesn’t fix the 404 error, then you can manually tell your web server to redirect users to the Yoast SEO’s sitemap page.

To do this, you’ll need to add the following code to your .htaccess file.

# Yoast SEO - XML Sitemap Rewrite Fix
RewriteEngine On
RewriteBase /
RewriteRule ^sitemap_index.xml$ /index.php?sitemap=1 [L]
RewriteRule ^locations.kml$ /index.php?sitemap=wpseo_local_kml [L]
RewriteRule ^geo_sitemap.xml$ /index.php?sitemap=geo [L]
RewriteRule ^([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 [L]
RewriteRule ^([a-z]+)?-?sitemap.xsl$ /index.php?yoast-sitemap-xsl=$1 [L]
# END Yoast SEO - XML Sitemap Rewrite Fix

Note: If your WordPress website is installed in a subdirectory or folder (e.g. https://example.com/mywebsite/ ) then you’ll need to use the following code.

# Yoast SEO - XML Sitemap Rewrite Fix
RewriteEngine On
RewriteBase /mywebsite/
RewriteRule ^sitemap_index.xml$ /index.php?sitemap=1 [L]
RewriteRule ^locations.kml$ /index.php?sitemap=wpseo_local_kml [L]
RewriteRule ^geo_sitemap.xml$ /index.php?sitemap=geo [L]
RewriteRule ^([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 [L]
RewriteRule ^([a-z]+)?-?sitemap.xsl$ /index.php?yoast-sitemap-xsl=$1 [L]
# END Yoast SEO - XML Sitemap Rewrite Fix

Don’t forget to replace /mywebsite/ with your subdirectory name.

This code simply tells your web server which pages to display when users access Yoast SEO’s XML sitemaps.

You can now try viewing your XML sitemap to see if this resolved your issue.

3. Switch to an XML Sitemaps Plugin

If the above-mentioned methods didn’t solve the 404 error on Yoast SEO’s XML sitemap page, then you can try using a separate plugin to generate XML sitemaps for your website.

The disadvantage of this approach is that you’ll have to rely on a separate plugin to generate XML sitemaps and Yoast SEO for other SEO features.

First, you need to install and activate the XML Sitemaps plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

Since you are using Yoast SEO, it will automatically show you a notification to either disable the XML Sitemaps plugin or Yoast SEO’s sitemap functionality.

Yoast SEO XML Sitemap conflict warning

Click on the Toggle Yoast SEO’s XML Sitemap button to continue.

This will bring you to the Features tab under the SEO » General page. From here, you need to scroll down to the XML Sitemaps option and switch it off.

Disabling XML sitemaps in Yoast SEO

Don’t forget to click on the Save changes button to store your settings.

You can now switch to the Settings » XML-Sitemap page to configure your sitemaps. For most websites, default settings would work out of the box.

XML Sitemaps settings

You can now go ahead and submit the XML sitemap URL to Google search console and other search engines.

Sitemap URL

4. Switch to the All in One SEO for WordPress

If all steps to troubleshoot fail and you don’t want to use a separate plugin to generate XML sitemaps, then this method may help you fix the sitemap 404 error issue.

For this method, you’ll need All in One SEO for WordPress. It is the best WordPress SEO plugin on the market and a much better Yoast SEO alternative. You can see our Yoast vs All in One SEO comparison for more details on the differences.

All in One SEO (AIOSEO) comes with advanced XML sitemaps with easy-to-manage options that give you full control of what to include or exclude from your XML sitemaps.

First, you need to install and activate the All in One SEO for WordPress plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Note: There is also a free version of All in One SEO for WordPress which also includes most XML sitemap features except for Video and News sitemaps.

Upon activation, the plugin will walk you through a setup wizard. You can follow our guide on how to properly setup All in One SEO plugin for WordPress if you need help during setup.

All in One SEO setup

All in One SEO will also allow you to import SEO data from Yoast SEO.

This ensures that all your previous SEO meta tags and titles remain unchanged.

Import Yoast SEO data

After the initial setup, you can simply go to All in One SEO » Sitemaps page to configure XML sitemap settings.

All in One SEO sitemaps settings

You can click on the Open Sitemap button to see if it fixed the sitemap 404 error in WordPress.

After that, you configure sitemap settings if needed.

For instance, All in One SEO allows you to choose what to include in your sitemaps. You can add or remove post types, taxonomies, individual posts and pages.

All in One SEO sitemaps advanced settings

All in One SEO also allows you to create video, news, RSS sitemap, and HTML sitemap for your website.

Additional sitemaps

These sitemaps can also be submitted to Google Search Console and other search engines. This helps search engines quickly find newer content on your website.

We hope this article helped you fix Yoast SEO Sitemap 404 error in WordPress. You may also want to see our complete WordPress troubleshooting guide or see how to fix common WordPress errors.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us.

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience building WordPress websites. We have been creating WordPress tutorials since 2009, and WPBeginner has become the largest free WordPress resource site in the industry.

Ошибка 404 в карте сайта, в основном означает, что карта сайта не существует по целому ряду причин которые решаются следующими способами:

  1. Сброс структуры  ссылок –  распространенный способоб решения проблемы с ошибкой 404.  Переходим в Admin панель > Настройки> Постоянные ссылки и нажимаем  кнопку сохранить, не изменяя ничего. ( Мне помог данный способ )
  2. Убедитесь , что записи или страницы существуют для того, чтобы создать карту сайта.

Чтобы сделать карту сайта в плагине yoast достаточно перейти в  SEO -> XML карта сайта и нажать  сохранить изменения.

yoast seo

yoast seo – создание карты сайта

Если вы при переходе по ссылке карты,  видите белый экран, то это особенность хостинга, обычно, проблем с яндексом и гуглом не возникает. Они такую карту видят.

Проверить карту можно исходным кодом.

Адрес карты  будет site.ru/sitemap_index.xml

Обязательно укажите его в robots.txt

Notice: There is no legacy documentation available for this item, so you are seeing the current documentation.

If you are seeing a 404 error Page Not Found when viewing the sitemaps generated by All in One SEO then this article will help you troubleshoot this.

There are a number of reasons why All in One SEO cannot generate a sitemap and WordPress returns a Page Not Found error. These are listed below along with steps to check whether this is affecting your site.

In This Article

  • The sitemap is disabled
  • There is no content
  • The content is set to noindex
  • The NGINX rewrite rules haven’t been added
  • Permalinks are set to Plain
  • The sitemap name has been changed in the database
  • CDN Plugin includes XML or XSL

The sitemap is disabled

First, check whether you’ve enabled the sitemap by going to All in One SEO » Sitemaps and click on the tab for the sitemap you’re having problems with.

Is the Enable Sitemap setting toggle in the On position? If it’s not, then click the toggle to enable the sitemap and click the Open Sitemap button to view the sitemap.

Enable Sitemap toggle and Open Sitemap button on Sitemaps screen

If you are using the Video Sitemap and/or the News Sitemap in All in One SEO, then you should also use the main XML Sitemap in All in One SEO.

There is no content

This may seem like a silly question to ask, have you made sure that you have published content on your site that you’re including in the sitemap?

Check the Post Types and Taxonomies settings to verify which content you’ve selected to include in your sitemap.

If this is the News Sitemap, then you must have content that has been published in the last 48 hours. Any content older than this is not included in the News Sitemap as per Google’s requirements.

The content is set to noindex

This is directly related to “There is no content” above. All in One SEO does not include content in the sitemap that is set to Noindex.

So if you’ve set the Show in Search Results to No under Search Appearance or enabled No Index using the Robots Meta settings under Search Appearance or on your content then this content will be excluded from the sitemap.

The NGINX rewrite rules haven’t been added

NOTE:
Rewrite rules should no longer be necessary if you’re running All in One SEO version 4.2.1 or later.

If your server is running NGINX then you may need to add the NGINX rewrite rules here.

Permalinks are set to Plain

If you’re on All in One SEO version 4.2.2 or lower then sitemaps will only work with “pretty permalinks”.
Go to Settings » Permalinks on your site and verify that it’s set to something other than Plain.

The sitemap name has been changed in the database

This can be a little more difficult to check for. The easiest way is to go to All in One SEO » Tools » Import / Export and in the Export Settings area, check the box for Sitemaps and click the Export Settings button.

Export sitemap settings from Import/Export tool

Open the aioseo-export-settings.json file that was downloaded to your computer and search for “filename”. If the value is anything other than “sitemap” for the XML Sitemap and “video-sitemap” for the Video Sitemap then the filename of the sitemap has been changed.

You can change it back in the export file and then import the settings.

CDN Plugin includes XML or XSL

If you’re using a CDN service or CDN plugin, then check to see if deactivating the plugin or service resolves the problem. Some CDN services and plugins include XML and XSL URLs when they shouldn’t.

To exclude the XML Sitemap from caching, please refer to the instructions here.

If you are using a different plugin or caching is done at the server level then contact the plugin developer, service provider, or your hosting company to find out how to exclude XML and XSL URLs.

Notice: You are currently viewing the legacy documentation.

If you are seeing a 404 error Page Not Found when viewing the sitemaps generated by All in One SEO then this article will help you troubleshoot this.

There are several reasons why All in One SEO cannot generate a sitemap and WordPress returns a Page Not Found error. These are listed below along with steps to check whether this is affecting your site.

There is no content

This may seem like a silly question to ask, have you made sure that you have published content on your site that you’re including in the sitemap?

Check the Post Types and Taxonomies settings to verify which content you’ve selected to include in your sitemap.

If this is the News Sitemap, then you must have content that has been published in the last 48 hours. Any content older than this is not included in the News Sitemap as per Google’s requirements.

The content is set to noindex

This is directly related to «There is no content» above. All in One SEO does not include content that is set to Noindex.

So if you’ve selected content in the Default to NOINDEX setting under All in One SEO » General Settings » Noindex Settings or enabled Noindex this page/post on your content then this content will be excluded from the sitemap.

The NGINX rewrite rules haven’t been added

If your server is running NGINX then you may need to add the NGINX rewrite rules here.

Permalinks are set to Plain

The sitemaps will only work with «pretty permalinks» so go to Settings » Permalinks on your site and verify that it’s set to something other than Plain.

The sitemap name has been changed in the database

This can be a little more difficult to check for. The easiest way is to go to All in One SEO » Importer & Exporter and check the box for Export Settings, uncheck all other boxes and click the Export button.

Open the settings_aioseop file that was downloaded to your computer and search for «filename». If the value is anything other than «sitemap» for the XML Sitemap and «video-sitemap» for the Video Sitemap then the filename of the sitemap has been changed.

You can change it back in the export file and then import the settings.

CDN Plugin includes XML or XSL

If you’re using a CDN service or CDN plugin, then check to see if deactivating the plugin or service resolves the problem. Some CDN services and plugins include XML and XSL URLs when they shouldn’t.

To exclude the XML Sitemap from caching, please refer to the instructions here.

If you are using a different plugin or caching is done at the server level then contact the plugin developer, service provider, or your hosting company to find out how to exclude XML and XSL URLs.

Понравилась статья? Поделить с друзьями:
  • Sisl 106 ошибки
  • Sirona dac universal коды ошибок
  • Sirius ошибка 134
  • Sirius d42 ошибка датчика распредвала
  • Sirio entry 230 ошибка е3 dry run