Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
Coupe WPB
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

Comment corriger l’erreur 404 du plan de site WordPress SEO de Yoast ?

Note éditoriale : Nous percevons une commission sur les liens des partenaires sur WPBeginner. Les commissions n'affectent pas les opinions ou les évaluations de nos rédacteurs. En savoir plus sur Processus éditorial.

Vous essayez de corriger l’erreur 404 du plan du site de Yoast SEO sur WordPress ?

Yoast SEO est l’une des extensions de référencement les plus populaires pour WordPress. En raison d’un conflit entre les extensions en conflit ou de Réglages WordPress incorrects, il peut afficher une erreur 404 lorsque vous essayez de visiter votre sitemap XML.

Dans cet article, nous allons vous afficher comment corriger facilement l’erreur 404 du sitemap XML de Yoast SEO sur WordPress.

Fixing Yoast SEO XML sitemap 404 error in WordPress

Quelle est la cause de l’erreur 404 du plan de site de Yoast SEO sur WordPress ?

Le plan du site Yoast SEO aide les moteurs de recherche à trouver tout le contenu de votre site que vous souhaitez qu’ils trouvent et indexent.

Corriger l’erreur garantit que les moteurs de recherche peuvent accéder à votre plan de site et découvrir toutes les pages et le contenu de votre site, ce qui peut prospecter une meilleure visibilité et un meilleur classement dans les moteurs de recherche. Cela aidera également à classer votre contenu plus rapidement que sans plan du site.

WordPress est livré avec un plan de site XML par défaut que vous pouvez envoyer à Google Search Console et à d’autres moteurs de recherche.

Ce sitemap.xml peut être consulté en saisissant l’URL suivant dans la barre d’adresse de votre navigateur.

https://example.com/sitemap.xml

Cependant, ce plan de site généré par défaut par WordPress est très basique. Pour corriger cela, tous les meilleurs plugins de référencement WordPress comme All in One SEO pour WordPress ou le plugin Yoast SEO créent leurs propres sitemaps XML avec plus de mis avant.

Lorsque vous utilisez le plan XML du site généré par votre extension WordPress SEO, ces extensions réécrivent le raccourci par défaut du plan XML du site de WordPress.

Cela signifie que l’URL du sitemap mentionnée ci-dessus enverra désormais les utilisateurs/utilisatrices vers les sitemaps générés par votre extension WordPress SEO.

Malheureusement, cela peut provoquer une erreur 404 sur certains sites en raison d’extensions en conflit ou de réglages WordPress incorrects.

Ceci étant dit, voyons comment corriger facilement l’erreur 404 du plan du site WordPress dans l’extension Yoast SEO.

1. Actualiser la structure permalienne de WordPress

WordPress est livré avec une structure d’URL favorable au référencement (également appelée permaliens). Cette structure URL utilise un système de redirection pour indiquer à votre serveur hébergeur quelle page charger lorsqu’un utilisateur saisit une URL dans son navigateur.

Normalement, ces réglages de permaliens sont automatiquement mis à jour lorsque vous apportez des modifications à votre site.

Cependant, il arrive que WordPress ne parvienne pas à actualiser la structure des permaliens, ce qui peut entraîner l’apparition de l’erreur 404 du sitemap de Yoast SEO.

Cela peut être facilement corrigé en visitant la page Réglages  » Permaliens dans la zone d’administration de WordPress et en cliquant simplement sur le bouton  » Enregistrer les modifications « .

Update permalinks

Le réglage des permaliens de WordPress sera ainsi actualisé. Vous pouvez maintenant visiter votre page sitemap xml pour voir si cela a corrigé votre problème.

Si cela n’a pas corrigé le problème, vous pouvez continuer à lire.

2. Mettre à jour manuellement les permaliens

Si actualiser la structure des permaliens de WordPress ne corrige pas l’erreur 404, vous pouvez alors indiquer manuellement à votre serveur web de rediriger les utilisateurs/utilisatrices vers la page du plan du site de Yoast SEO.

Pour ce faire, vous devez ajouter le code suivant à votre fichier .htaccess.

# 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 : Si votre site WordPress est installé dans un sous-répertoire ou un dossier (par exemple https://example.com/mywebsite/ ), vous devrez utiliser le code suivant.

# 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

N’oubliez pas de remplacer /mywebsite/ par le nom de votre sous-répertoire.

Ce code indique simplement à votre serveur web les pages à afficher lorsque les utilisateurs/utilisatrices accèdent aux sitemap.xml de Yoast SEO.

Vous pouvez maintenant essayer de voir votre sitemap XML pour voir si cela résout votre problème.

3. Passer à une extension de sitemap xml

Si les méthodes mentionnées ci-dessus n’ont pas permis de résoudre l’erreur 404 sur la page sitemap XML de Yoast SEO, vous pouvez alors essayer d’utiliser une extension distincte pour générer des sitemaps XML pour votre site.

L’inconvénient de cette approche est que vous devrez vous appuyer sur une extension distincte pour générer des sitemaps XML et sur Yoast SEO pour les autres fonctionnalités de référencement.

Tout d’abord, vous devez installer et activer l’extension XML Sitemaps. Pour plus de détails, consultez notre guide étape par étape sur l’installation d’une extension WordPress.

Puisque vous utilisez Yoast SEO, il vous affichera automatiquement une notification pour désactiver soit l’extension XML Sitemaps, soit la fonctionnalité sitemap de Yoast SEO.

Yoast SEO XML Sitemap conflict warning

Cliquez sur le bouton Permuter le plan XML du site de Yoast SEO pour continuer.

Cela vous amènera à l’onglet Fonctionnalités sous la page SEO  » Général. À partir de là, vous devez défiler vers le bas jusqu’à l’option XML Sitemaps et la désactiver.

Disabling XML sitemaps in Yoast SEO

N’oubliez pas de cliquer sur le bouton « Enregistrer les modifications » pour stocker vos réglages.

Vous pouvez maintenant passer à la page Réglages  » XML-Sitemap pour définir vos sitemaps. Pour la plupart des sites, les réglages par défaut fonctionneront sans problème.

XML Sitemaps settings

Mais vous pouvez toujours définir les réglages en fonction de vos besoins.

Vous pouvez maintenant envoyer l’URL du sitemap XML à la console de recherche de Google et à d’autres moteurs de recherche.

Sitemap URL

4. Passer à All in One SEO pour WordPress

Si toutes les étapes du dépannage échouent et que vous ne souhaitez pas utiliser une extension distincte pour générer des sitemaps XML, cette méthode peut vous aider à corriger l’erreur sitemap 404.

Pour cette méthode, vous aurez besoin de All in One SEO pour WordPress. C’est la meilleure extension de référencement WordPress sur le marché et une bien meilleure alternative à Yoast SEO.

Vous pouvez consulter notre comparatif Yoast vs All in One SEO pour plus de détails sur les différences.

All in One SEO (AIOSEO) est livré avec des sitemaps XML avancés avec des options faciles à gérer qui vous donnent un contrôle total sur ce qui doit être inclus ou exclu de vos sitemaps XML.

Tout d’abord, vous devez installer et activer l’extension All in One SEO pour WordPress. Pour plus de détails, consultez notre guide étape par étape sur l’installation d’une extension WordPress.

Note : Il existe également une version gratuite de All in One SEO pour WordPress, qui comprend la plupart des fonctionnalités de sitemap XML avant les sitemaps vidéo et nouvelle.

Une fois activé, le plugin vous guidera à travers un assistant de configuration. Vous pouvez suivre notre guide sur la façon de définir correctement l’extension All in One SEO pour WordPress si vous avez besoin d’aide pendant la configuration.

All in One SEO setup

All in One SEO vous permettra également d’importer des données de référencement depuis Yoast SEO.

Cela permet de s’assurer que tous vos méta identifiés et titres SEO précédents restent inchangés.

Import Yoast SEO data

Après la configuration initiale, vous pouvez aller sur la page All in One SEO  » Sitemaps pour configurer les paramètres du sitemap XML.

All in One SEO sitemaps settings

Vous pouvez cliquer sur le bouton Ouvrir le plan du site pour voir si cela a corrigé l’erreur 404 du plan du site dans WordPress.

Ensuite, vous définissez les réglages du plan de site si nécessaire.

Par exemple, All in One SEO vous permet de choisir les éléments à inclure dans vos plans de site. Vous pouvez ajouter ou retirer des types de publication, des taxonomies, des posts individuels et des pages.

All in One SEO sitemaps advanced settings

All in One SEO vous permet également de créer des vidéos, des actualités, un plan de site RSS et un plan de site HTML pour votre site.

Additional sitemaps

Ces plans de site peuvent également être envoyés à Google Search Console et à d’autres moteurs de recherche. Cela aide les moteurs de recherche à trouver rapidement du contenu plus récent sur votre site.

Nous espérons que cet article vous a aidé à corriger l’erreur Yoast SEO Sitemap 404 sur WordPress. Vous pouvez également consulter notre guide complet de dépannage WordPress ou voir comment corriger les erreurs courantes sur WordPress.

Si vous avez aimé cet article, veuillez alors vous abonner à notre chaîne YouTube pour obtenir des tutoriels vidéo sur WordPress. Vous pouvez également nous trouver sur Twitter et Facebook.

Divulgation : Notre contenu est soutenu par les lecteurs. Cela signifie que si vous cliquez sur certains de nos liens, nous pouvons gagner une commission. Consultez comment WPBeginner est financé, pourquoi cela compte et comment vous pouvez nous soutenir. Voici notre processus éditorial.

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

L'ultime WordPress Toolkit

Accédez GRATUITEMENT à notre boîte à outils - une collection de produits et de ressources liés à WordPress que tous les professionnels devraient avoir !

Reader Interactions

243 commentairesLaisser une réponse

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. D Moran says

    I just bought the Genesis Framework theme and then installed the yoast seo plugin and activated. I then tried to generate my sitmap and get this same 404 error.

    « Not found, error 404
    The page you are looking for no longer exists. Perhaps you can return back to the site’s homepage and see if you can find what you are looking for. Or, you can try finding it by using the search form below. »

    Does this mean that the theme I got from Genesis is badly coded? Did I waste my money??

      • Chris Sparks says

        I had a similar issue after installing Yoast SEO. I deactivated the plugin, then restarted and the URL system picked up and started working as expected. This seems to be related to how the permalink structure is set up as only one of our sites has experienced this issue.

        Thanks for posting!

  3. john says

    hello I tried fixing the 404 error code and now I get the following messege:

    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    and after that i remove the folder of plugin seo and nothing is working again what can i do???

  4. Eoin Healy says

    Another easy way to fix the sitemaps is to simply disable sitemap functionality and enable it again…. works for me every time, doesn’t matter what plugins i have installed.

    In Admin, to go SEO > XML SItemaps
    Under ‘XML Sitemap’ uncheck ‘Check this box to enable XML sitemap functionality.’, hit save, check the box again and hit save.

  5. Margot Barrios says

    I already fixed using the first option, how would I know if it’s working already? Should I need to wait for Google’s webmaster report? This is where I saw the 404 error on my site.

  6. Eric Kuhn says

    I replaced the edit files with the XML sitemap fix and completely removed what was there initially. Google webmaster tools has accepted the sitemap however, my sitemap doesn’t show a 404 or anything. Does that mean everything is ok?

  7. Melissa says

    I tried fixing the 404 error code and now I get the following messege:

    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

    Apache/2.2.23 (Unix) mod_ssl/2.2.23 OpenSSL/1.0.0-fips mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server at artattackfx.com Port 80

    I cannot access the WP Admin Site… How can I revert to before I added this code :

    # WordPress SEO – XML Sitemap Rewrite Fix
    2

    3
    RewriteEngine On
    4
    RewriteBase /
    5
    RewriteRule ^sitemap_index\.xml$ /index.php?sitemap=1 [L]
    6
    RewriteRule ^([^/]+?)-sitemap([0-9]+)?\.xml$ /index.php?sitemap=$1&sitemap_n=$2 [L]
    7

    8
    # END WordPress SEO – XML Sitemap Rewrite Fix

    to the htacess code in YOAST? Please Help.

      • Remi says

        I thought I followed to the letter your second suggestion but have the same issue as Melissa. Now waiting for the Webhost for a solution. What about adding a warning in your second solution that it can lead to a 500 Internal Server Error.

        • WPBeginner Support says

          You can also revery back by editing the file your modified through FTP. Connect to your website using an FTP client. Locate the file you modified (.htaccess or class-sitemaps.php) and remove the code you added. Alternately, you can also delete the WordPress SEO folder from your wp-content/plugins/ directory through FTP.

  8. Toni says

    Can anyone advise on how to delete the post-sitemap.xml as I cannot find it in my root directory! I have turned of the generate sitemap in Yoast.

  9. Koen says

    Hi,
    I have wordpress 3.6 with Avada theme and WordPress SEO by Yoast plugin.
    First I got the 404 error page.
    Then I applied the .htaccess fix without any result.
    Then I applied the class-sitemaps.php fix, now the sitemap returns a blank page.
    What to do?
    Please help. Avada isn’t a crappy theme, I think.
    Cheers, Koen

  10. Gbenga Adebayo says

    Hi,

    Appears i still have a few issues to sort out. Google webmaster reporting http 403 errors with my sitemap. I can’t find the sitemap anymore in my root folder. I can navigate to the sitemap using my browser without getting a 404 error message.

    Any suggestions or help is appreciated.

  11. Madhu says

    Phew … Thanks again!
    I updated my SEO pluggin and the sitemaps had the same issue.
    I had to incorporate both the fixes.

  12. Rajesh Thakur says

    Thanks First one did worked for me need to clear w3 cache after that and wait a little also disable XML sitemap checkbox and check it again

  13. Erica says

    I tried the second set of instructions and it resulted in a « Fatal Error » message and I was unable to access my WP site, or even the login page. Scary!

  14. Nyla says

    Hi all

    I’m an very frustrated to say that I am too getting 404 error, I’m using kriesi replete theme.

    I have tried both options however nither worked

    I’m not sure if I’m doing it write, can somebody explain…. In simple terms are we deleting and replacing the existing code on both options? Or just adding? It’s not clear or does it make a difference if the prexisting remains

    Thanks in advance

  15. Rohin says

    Damn helpful.
    One of my clients had this problem and just took 5 minutes to solve the issue. Just because of this post.
    Thanks a lot.
    :)

  16. Ron MacGregor says

    I am new to WordPress and have only begun a using the Canyon theme. I got the 404 message as I was attempting to install a « contact info » plugin. Does anyone know if I just begin at the very beginning again, i.e. go through my GoDaddy account to reinstall WordPress and then reinstall the Canyon theme – might that solve the 404 problem?

  17. Jack Logan says

    I have two sets of websites (WordPress Multisite installs) and I have no issues with sitemaps on one of them and I get a 404 error with category_sitemap.xml on the other one.

    I tried both fixes suggested in this post, but they don’t solve the issue. The only thing that works is going to Posts -> Categories – Edit and changing from « Auto detect » to « Always include » on all categories.

    The issue here is that I have over 200 sites, and about 8 categories per page, so it would take too long to do it just to get category sitemaps, even though I could use it….

    Is there any way to mass change all the categories on WP Multisite to « Always include ». I think this would be a solution that would work for everyone.

    Thank you.

  18. Jacques Karsten says

    If none of this works try create a file named sitemap_index.xml on your html root through ftp and make sure the permissions are set and the plugin should then take care of the rest.

  19. Adam says

    I’m not sure which part worked for me, but I found this page because I was getting the 404, too. I disabled the XML Sitemaps in the plugin, then enabled it and checked the boxes to exclude posts (since I only have pages). Now, it is working perfectly.

  20. Brad Dalton says

    I think there are other issues with this plugin as well.

    The attachment pages aren’t all redirecting to the parent page which is something i noticed today.

  21. Michi says

    No other comment since April. That has been 5 months since. I have the 404 still in Sept 2012! Was able to fix it with the .htaccess fix. Thanks for posting
    Just wondering why this is STILL an issue.

  22. Sandie Wright says

    It worked for me! Open the class-sitemaps.php file located in plugins > wordpress-seo > inc folder. then find the code around line 79 and replace the old code with this new code:
    /**
    * 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();
    }
    Then, go back to your WP admin page and then go to the SEO plugin > XML sitemaps, and then click the button again (XML Sitemap). The 404 should be replaced with your sitemaps! Easy peasy.

  23. Jody says

    Thanks for jacking up my site! i tried your code and now i got a 500 internal service error i have been trying for hours to fix! thanks for making my little problem into a HUGE problem!

  24. Eva says

    Hi!

    Thank you so much for posting this article! With the first fix, I managed to solve the 404 issue for most sitemaps, though there’s still 1 that is showing the error… Any suggestions of what to do?

    I thought about exporting the Yoast SEO settings and reinstalling the plugin to see if that does the trick. Just to be on the safe side: does exporting literally export all settings, even the page/article level SEO customizations OR only the general settings?

    Thanks!

    Eva

  25. Sara says

    Thanks so much – this worked for me.

    I know you said the plugin is good, and the problem is in the theme or other plugins, but I tried disabling all plugins and switching to the twenty eleven theme, and the sitemap still gave a 404 error. The only thing that worked for me is editing the htaccess file.

    • Boah says

      … and I tried the same thing. Removed all the plugins, all the themes, and tried it again: 404 error. To make it worse: I’d have an .htaccess file because of IIS. Which options are there for me?

  26. Rusty Solomon says

    I guess SEO Yoast recent update have sitemap problem as I cant see any sitemap on the URL the plugin provide. Let me know if any one has the same issuee and Fix.

    Also is there any good plugin avaialble as same as SEO Yoast.

    Thanks & Regarsd

  27. Jay Wylie says

    Hi, I have tried the first fix, but broke my site in the process. Is there anyway to re-edit my htaccess file, to stop it causing a 500 internal server error?

    thanks

  28. Colin says

    Hi Joots, I’m using the latest version of the SEO plugin. I’m going over previous posts and completeing the various fields, « Focus Keyword », « SEO Title », etyc, etc but after I update the post and then go back to « Edit » those fields are then blank again. I wondered how I could rectify this?

    Thanks,

    Colin
    Liverpool, UK

  29. Saki_Kawa says

    The solution doesn’t resolved my issue.. I still have a blank page at post-sitemap.xml
    Does someone have a solution?? Or I need to unistall this plugin and find another one for my sitemap..

  30. Adam Parnala says

    Hi, I don’t have any problems with yoast seo plug in as I’m currently using it. I just I want to ask if it is better than the all in one seo plug in? I’m just curious because I found out that a lot of blogs in my niche uses it. Which is better? the all in one seo or yoast seo? (I’m already used to yoast). Oh, can I also ask how to set multiple focus keyword in Yoast seo? because there is only one field and I can’t figure out how to set a few more keywords for it. Sorry for my questions I hope you can answer me. Thanks!

    • Craig says

      I’d be willing to test a better fix for this issue but I’m reluctant to commit to a timeframe as I’m not really good at keeping on top of my todo’s since my stroke. (This is one of the reasons I haven’t returned to work as a PHP coder yet.)

      And I’d be *very* interested in helping if I happen to be experiencing any of the issues cited above.

      Craig

  31. Stephen Cronin says

    Hmm, I think the second part is going to cause the rewrite rules to be flushed on every page load, which <a href= »http://codex.wordpress.org/Rewrite_API/flush_rules »>the Codex</a> warns not to do due to performance issues:
     
    <blockquote>Because this function can be extremely costly in terms of performance, it should be used as sparingly as possible – such as during activation or deactivation of plugins or themes. Every attempt should be made to avoid using it in hooks that execute on each page load, such as init.</blockquote>
     
    I’m guessing that’s why Joost isn’t doing that by default :)
     
    Of course, I could be wrong because I don’t know his plugin well enough.

    • jonbish says

      I was under the same impression when this article came through my RSS. I’m pretty sure going to your permalinks settings page would accomplish the same thing without having to flush the rewrite rules every time the page loads.

      • yoast says

         @jonbish Unless you’re running a crappy plugin or theme that DOES flush on every pageload before this plugin gets a chance to get its rewrites in.

        • wpbeginner says

           @yoast  @jonbish Yes we understand that this is probably a compatibility issue. Yoast sitemaps work fine on our sites. We had to do this on a client’s site.

        • yoast says

           @wpbeginner  @jonbish I know YOU understand, question is: do your readers :) We’re working on a fix for these kinds of issues in core btw: http://core.trac.wordpress.org/ticket/18450

    • yoast says

      You’re 100% right Stephen. Something else *is* doing it on each pageload, which forces this « fix », which isn’t a fix but a workaround for a broken theme or other plugin…

    • icejava says

      Its probably not blank, just how your browser renders XML (maybe Chrome, mine does it too). View the source code of the page and you shall see the light ;)

      • Editorial Staff says

        This happens for a few reasons. Either you’re running low on memory. Two the file that generates the visual layout in your /wp-content/ directory is not working properly. Perhaps because you blocked the php execution?

        Administrateur

Laisser une réponse

Merci d'avoir choisi de laisser un commentaire. Veuillez garder à l'esprit que tous les commentaires sont modérés selon notre politique de commentaires, et votre adresse e-mail ne sera PAS publiée. Veuillez NE PAS utiliser de mots-clés dans le champ du nom. Ayons une conversation personnelle et significative.