Vos publications WordPress renvoient-elles une erreur 404 sur votre site ?
Cette erreur se produit lorsque vous pouvez accéder à votre zone d’administration WordPress et à votre blog, mais que lorsque vous essayez d’ouvrir une publication, vous voyez apparaître le message « 404 Not Found ».
Dans cet article, nous allons vous afficher comment corriger les publications WordPress renvoyant des erreurs 404.
Quelle est la cause de l’erreur 404 dans les publications de WordPress ?
WordPress est un système de gestion de contenu (CMS) puissant, mais une légère modification peut parfois rendre votre site WordPress inaccessible.
Dans certains cas, vous ne pourrez pas accéder à votre zone d’administration WordPress ou au site lui-même, comme dans le cas de l’erreur de serveur interne ou de l’erreur d’établissement d’une connexion à la base de données.
En revanche, lorsque vos publications WordPress renvoient des erreurs 404, vous serez toujours en mesure d’accéder à votre zone d’administration et de voir votre site WordPress sur l’interface publique. Cependant, lorsque vous cliquez sur une publication de blog, vous verrez un message indiquant « 404 Not Found » (404 non trouvé).
Bien que ce message d’erreur puisse être effrayant, il ne signifie pas que vous avez perdu vos publications WordPress. Au lieu de cela, votre fichier .htaccess a probablement été supprimé, ou quelque chose s’est mal passé avec les règles de réécriture sur votre blog.
Ceci étant dit, voyons comment corriger les publications WordPress renvoyant des erreurs 404. Vous pouvez utiliser les liens ci-dessous pour passer directement aux différentes solutions :
Tutoriel vidéo
Si vous préférez les instructions écrites, continuez à lire.
Méthode 1 : Corrigez vos Réglages Corrigé
Les publications WordPress peuvent renvoyer des erreurs 404 en raison de problèmes liés aux règles de réécriture dans votre fichier .htaccess. Dans la plupart des cas, vous pouvez corriger le problème en mettant à jour vos Réglages permaliens.
Il suffit d’aller dans Réglages » Permaliens dans votre administration WordPress, et de cliquer sur le bouton » Enregistrer les modifications « .
Il n’est pas nécessaire d’apporter des modifications aux réglages permaliens eux-mêmes. Cela mettra à jour vos réglages permaliens et effacera les règles de réécriture.
Dans la plupart des cas, cette solution corrige l’erreur 404 des publications WordPress. Cependant, si cela ne fonctionne pas, vous devez probablement mettre à jour votre fichier .htaccess manuellement.
Méthode 2 : Mettre à jour le fichier .htaccess de WordPress
Avant de commencer, veillez à sauvegarder le fichier .htaccess de WordPress. En cas de problème, vous pourrez facilement restaurer le fichier d’origine.
Vous devez maintenant vous connecter à votre serveur à l’aide d’un client FTP tel que FileZilla ou de l’application Gestionnaire de fichiers du tableau de bord de votre hébergeur WordPress.
Ensuite, vous devrez trouver et modifier le fichier .htaccess, qui se trouve au même endroit que des dossiers comme /wp-content/ et /wp-includes/.
Il suffit de cliquer avec le bouton droit de la souris sur le fichier et de sélectionner « Droits du fichier ».
Vous pouvez rendre le fichier accessible en écriture en modifiant ses droits à 666.
Saisissez simplement « 666 » dans la case « Valeur numérique » et cliquez sur « OK ».
Ensuite, vous devez répéter les étapes de la première méthode de notre tutoriel. Une fois que vous avez fait cela, n’oubliez pas de modifier les droits pour revenir à 660.
Vous pouvez également modifier le fichier et y ajouter du code.
Une fois que vous avez ouvert le fichier .htaccess avec un éditeur/éditrices de texte, insérez simplement ce code :
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Méthode 3 : Contactez votre fournisseur d’hébergement
Si aucune des solutions ci-dessus n’a corrigé l’erreur WordPress posts returning 404, nous vous recommandons de contacter votre fournisseur d’hébergement WordPress. Il se peut qu’il y ait une erreur de leur côté, ou ils pourraient être en mesure de vous aider à dépanner le problème.
Veuillez également consulter notre guide sur la manière de demander correctement un support WordPress et de l’obtenir.
Méthode 4 : Corriger les publications WordPress renvoyant l’erreur 404 sur les serveurs locaux
Si vous utilisez un serveur local à des fins de test, vous devrez activer mod_rewrite dans la configuration Apache de votre site MAMP, WAMP ou XAMPP.
Cela permettra à WordPress de générer des URL propres et d’éviter l’erreur 404 pour les publications et les pages sur votre serveur local.
La manière de procéder diffère selon la plateforme utilisée. Les personnes qui utilisent XAMPP peuvent ouvrir leur panneau de contrôle et cliquer sur le bouton ‘Config’ dans Actions. Sélectionnez ensuite « Apache (httpd.conf) ».
Ensuite, vous devrez trouver cette ligne #LoadModule rewrite_module modules/mod_rewrite.so
et retirer le ‘#’ pour la décommenter.
Ceci chargera le mod_rewrite.
Ensuite, trouvez toutes les instances de AllowOverride None
et modifiez-les en AllowOverride All
.
La valeur « Tous » signifie que toutes les directives peuvent être remplacées.
Une fois cela fait, vous pouvez enregistrer le fichier httpd.conf et le fermer. Ensuite, dans le panneau de contrôle XAMPP, cliquez sur « Stop » sur le module Apache et sur « Start » à nouveau pour le redémarrer.
Ensuite, retournez dans votre Tableau de bord pour voir si vos permaliens fonctionnent.
Nous espérons que cet article vous a aidé à résoudre les publications renvoyant des erreurs 404 sur WordPress. Vous pouvez également consulter notre guide des erreurs WordPress les plus courantes et comment les corriger, ainsi que nos choix d’experts pour les meilleures extensions WordPress pour développer votre site.
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.
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!
Moinuddin Waheed says
This is one of the most occuring error for wordpress websites.
this is really frustrating as it seems to get stuck and leading to nowhere.
I have solved the issue by saving the permalink.
I didn’t know about the other steps.
I really appreciate the efforts to make it holistic by including all the steps to resolve this error.
WPBeginner Support says
Glad we could share the other options
Administrateur
mohadese esmaeeli says
Hello. The 404 error can be really frustrating, and we’ve all encountered it at least once. The situation becomes challenging when everything appears to be correct, there are no broken links, yet the 404 error persists. I faced this issue once, and it was resolved by adjusting the permalink settings.
amir says
Hi
in my case, a plugin named as « WebP Express » create a htaccess file in uploads folder that restrict my access to some images.
try rename or remove it and see if the problem still exist.
WPBeginner Support says
Thank you for sharing this suggestion to check for multiple htaccess files.
Administrateur
Eriab Nsereko says
Syed & the team u saved my whole entire day! My homepage was actually loading well.. but the other pages couldn’t load. So, I pasted the code in my .htaccess file and it did absolutely like magic.
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
WPBeginner Support says
Glad we could help!
Administrateur
David Helleskov Fønsbo says
Thanks – None of the suggested solutions did work for me. Looks like the typical permalink error but it isn’t.
Saving permalink again does not create a new .htaccess.
WPBeginner Support says
If none of the methods in our guide are working for you, please reach out to your hosting provider and they should be able to help fix the issue.
Administrateur
Victor says
The updating permalinks fix worked. Fastest solution ever. Thank you for writing this piece
WPBeginner Support says
You’re welcome, glad our guide was helpful!
Administrateur
Julie says
Thank you for the quick fix! Appreciate the help.
WPBeginner Support says
You’re welcome, glad our guide could help you!
Administrateur
Frank Thomas says
Thank you for this post. I was missing the .htaccess files after moving sites and of course the wordpress code in them. I’ve replaced it all and voila! We are live at 5. Thanks.
WPBeginner Support says
You’re welcome, glad to hear the guide helped!
Administrateur
anand says
i have try to your guideline but not working my website again showing same error 404
WPBeginner Support says
If none of the recommendations from our guide could solve your error, please reach out to your hosting provider and they should be able to take a look and help!
Administrateur
Harald says
Hi,
saving permalink helped me too, but it keeps returning over and over again after some days.
I have no clue what causes it.
WPBeginner Support says
If it is a constantly recurring error, we would recommend reaching out to your hosting provider and they can either look at their error logs for the site or keep an eye on your site for the specific error causing the problem.
Administrateur
Mete says
Thank you very much.solved my problem
WPBeginner Support says
Glad our guide was helpful!
Administrateur
Emmanuel says
This is my lifesaver. My site is working fine after modifying the .htaccess files.
Thanks a ton!
WPBeginner Support says
Glad our guide could help!
Administrateur
Jon says
For me the problem was I forced a redirect from mydomain.com to ww.mydomain.com, but in wordpress the site URL said mydomain.com. After changing the redirection to ww.mydomain.com -> mydomain.com everything worked.
WPBeginner Support says
Thanks for sharing this for those who may also have this issue!
Administrateur
Mario Nwolisah says
Thank you! It worked. I really appreciate.
WPBeginner Support says
Glad our article was helpful!
Administrateur
Jess says
Thank you – this saved me!
WPBeginner Support says
Happy to hear our guide could help!
Administrateur
Cristian says
Thank you, it works for me!!!
WPBeginner Support says
Glad our recommendations were able to assist!
Administrateur
Samir K Al Busaidy says
I was panicking and thinking that my website was hacked or had malware. As I read your writing and you wrote not to worry, I began to relax. The first option (permalink) worked for me immediately…
Thanks
WPBeginner Support says
Glad our guide was able to help
Administrateur
Udaykumar Posia says
This worked. Thank you so much.
WPBeginner Support says
Glad our guide could help
Administrateur
Max Legault says
On IIS there is no .htaccess file but the key is still the permalink settings. Just hitting Save didn’t fix it but changing the Custom Structure to Plain worked like a charm. Thanks for the push in the right direction.
WPBeginner Support says
Glad you were able to find the solution for your issue
Administrateur
Collin says
I love you for this! This was an easy fix. I was in full panic mode!
WPBeginner Support says
Glad our guide was able to help
Administrateur
Zack says
Thank you so much. It worked!
WPBeginner Support says
Glad our guide was helpful
Administrateur
Steve Barnard says
Dang! Can’t thank you enough for this – super simple fix worked perfectly – just hit save changes on the permalinks settings page and viola’ – my pages are back. Thank you!!
WPBeginner Support says
Glad our guide could help
Administrateur
A.S.M. Arifur Rahman says
Thanks a lot, settings saved method works, Now my post open fine.
kris says
honestly thank you so much! without fail your site always comes thru with answers that work. thank you so much!
(now I just wish I knew what caused it to get out of whack in the first place. oh well.)
Chris says
This article just saved me from a panic attack Lol. The solution worked great. Thanks for making this video.
Muhammad Tahir says
i didn’t solve this issue by using all the methods that you are discussed?
WPBeginner Support says
If none of our methods in this guide worked for you, we would recommend reaching out to the support for your hosting provider to ensure there is not an error on their end.
Administrateur
Duane Wiese says
None of the above suggestions worked so I did some further searching. I came across someone who suggested switching off the mod security under the security section in cpanel.
I tried this and it worked. I also tested it by switching it back on after a change and then trying another change and BAM, 404 error.
WPBeginner Support says
Thanks for sharing this should someone else run into this issue. Not every host allows access to that specific file but if you reach out to your host they can normally disable or change it for you
Administrateur
Dave Emma says
Disabling ModSecurity fixed mine.
I actually tried permalinks plus rewriting .htaccess, but that didn’t solve my problem. I’m glad I read comments. Many thanks guys for sharing.
Elango says
Thanks, it was so simple and the problem solved. No other pages were visible after I migrated to another server. I added the lines to .htaccess file and uploaded the same. Now all the pages are being displays without the 404 error and I am able to access my WP dashboard too. Thanks a lot.
WPBeginner Support says
Glad our guide was able to help
Administrateur
Islombek says
My posts are showing 404 error after installing ssl certificate. How can I fix it? I tried everything mentioned above, but none helped.
WPBeginner Support says
If you are changing your site’s URL to HTTPS you would want to follow our guide below:
https://www.wpbeginner.com/wp-tutorials/how-to-add-ssl-and-https-in-wordpress/
Administrateur
Dennis Yildirim says
My .htaccess file is exactly the same with that code but nevertheless I did whatever in the post. did not work, saved permalinks through admin console, did not work. Manually edits, no luck. Deleted the .htaccess and recreated it by saving it from admin console, again did not work. Nothing works. Don’t know how did it even work on others?
WPBeginner Support says
If none of the recommendations from our article were able to help we would recommend reaching out to your hosting provider as that can be a sign that there is an issue on your host’s end.
Administrateur
Kuldeep Singh says
You saved my day. I got this issue after transferring my site from one hosting to another. I couldn’t believe it was so simple to fix the issue. Many Thanks WpBeginner team!
WPBeginner Support says
Glad our guide was helpful
Administrateur
Rick says
I never reply to these things but just wanted to jump on here and say thank you! I’ve been having this issue a lot and having to wait ages for support to help me and so finally had a hunt around, found this, and can now fix it myself. You legend!! Much appreciated
WPBeginner Support says
Glad our guide was helpful
Administrateur
Elroy says
Thanks a lot Wpbeginner it woked just fine.
WPBeginner Support says
Glad our guide was helpful
Administrateur
Noble says
Thank you very much, it worked instantaneously!
WPBeginner Support says
Glad our guide could help
Administrateur
carol hannah says
Help! It didn’t work and I can’t possibly work out how to do the .htaccessfile thingy?
WPBeginner Support says
You would either need to use FTP which we cover on the page below:
https://www.wpbeginner.com/glossary/ftp/
Or reach out to your hosting provider and they would be able to assist.
Administrateur
Christopher Krohn says
Thank you, thank you, thank you!
WPBeginner Support says
Glad our guide was helpful
Administrateur
Dan says
Man this fixed my WP site! THANK YOU!
WPBeginner Support says
Glad our guide was helpful
Administrateur
Molly says
Thank you for a million time!!!!!
WPBeginner Support says
Glad our guide was helpful
Administrateur
Amin Omer says
Thank you very much
WPBeginner Support says
You’re welcome
Administrateur
Afan says
One of solutions to correct the issue with the Permalink change is simply delete the .htaccess file – WordPress will recreate it again automatically.
But, before you delete it, copy the file on your computer, just in case…
WPBeginner Support says
If someone has customized their htaccess file then that would be a good idea. Otherwise, WordPress should auto regenerate the default information in the file where most wouldn’t need to worry.
Administrateur
James Monroe says
Saving the permalinks settings worked perfectly. Such a simple solution to what looked like a serious problem! Thank you!
WPBeginner Support says
Glad our recommendation was helpful
Administrateur
mukhtar says
its works fine 100 %
and easy to solve my problem, we are very very thankful to you about it
WPBeginner Support says
Glad our guide was helpful
Administrateur
Sarah says
Wow!! I’ve spent all evening trying to fix this and that’s how easy it was! THANK YOU!!
WPBeginner Support says
Glad our guide was helpful
Administrateur
Rimzan farook says
Thanks fixed it as you described changed my post date to post name, thanks a ton
WPBeginner Support says
Glad our recommendations could help
Administrateur
Muhammad Zeeshan says
I’m facing 404 error while adding new plugin , theme , editing any post or product, editing any page ..
I’ve try to save permalinks and also tried to change .htaccess .. But not this given solution is working for me.
WPBeginner Support says
You would want to reach out to your hosting provider to see if you are running into any errors on their server’s end.
Administrateur
Ayobami says
I’m having error 404 issues on my website, I can’t access to the website at all what can I do?
WPBeginner Support says
You would use the htaccess method from this guide or reach out to your hosting provider to be able to assist you
Administrateur
samith says
I can’t login my WP dashboard seen « nginx 404 not found error »
WPBeginner Support says
For that specific error, you would want to reach out to your hosting provider to take a look.
Administrateur
Sammy says
A BIG Thank You… It solved the headache!
WPBeginner Support says
Glad our guide was helpful
Administrateur
Mihir says
I’m facing a problem where this is extension of my own website after every page and I don’t know how to fix it.
WPBeginner Support says
You would likely want to check under Settings>Permalinks to ensure everything is set correctly there
Administrateur
Daniel says
Thank you,
It solved my problem!
WPBeginner Support says
Glad our guide was helpful
Administrateur