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.
Pourquoi mes articles WordPress renvoient-ils une erreur 404 ?
Il y a plusieurs raisons pour lesquelles vos articles WordPress peuvent afficher une erreur 404 « Page non trouvée ». Il peut s’agir de
- Conflits de plugins ou de thèmes : Parfois, les plugins ou les thèmes que vous avez installés sur votre site peuvent interférer avec la manière dont WordPress gère les permaliens. Cela peut entraîner des liens brisés et des erreurs 404.
- Problèmes liés au code personnalisé : Si vous avez ajouté un code personnalisé à votre site web, il se peut que des erreurs dans le code affectent les permaliens ou provoquent d’autres conflits, ce qui entraîne des erreurs 404 pour vos articles.
- Problèmes avec votre fichier .htaccess : Le fichier .htaccess joue un rôle dans la manière dont WordPress structure les URL. Si ce fichier est corrompu ou manquant, il peut entraîner des erreurs 404 pour vos articles.
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 : Vérifier les conflits de plugins ou de thèmes et les problèmes de code personnalisé
Parfois, les plugins, les thèmes ou le code personnalisé que vous avez ajouté à votre site WordPress peuvent interférer avec les permaliens ou provoquer des conflits, entraînant des erreurs 404. Nous en avons nous-mêmes fait l’expérience lorsque nous testions des outils sur notre site de démonstration.
Une façon de résoudre ce problème est de désactiver temporairement les plugins. Les plugins peuvent parfois perturber la manière dont WordPress gère les liens.
Une fois que vous avez désactivé les plugins, vous pouvez les réactiver un par un en vérifiant si l’erreur 404 réapparaît après l’activation de chaque plugin. Si l’erreur réapparaît après l’activation d’un plugin spécifique, il se peut que ce dernier soit le coupable.
Vous pouvez ensuite rechercher des solutions liées à ce plugin ou contacter le développeur du plugin pour obtenir de l’aide.
De même, votre thème WordPress peut être à l’origine du conflit.
Pour vérifier, vous pouvez temporairement passer à un thème WordPress par défaut comme Twenty Twenty-Three ou Twenty Twenty-Four. Tout ce que vous avez à faire est d’aller dans Apparence « Thèmes et de cliquer sur « Activer » sur un thème par défaut.
Si l’erreur 404 disparaît avec le thème par défaut, cela indique un conflit potentiel avec votre thème actuel. Vous pouvez alors essayer de dépanner le thème ou envisager d’utiliser un autre thème.
Vous pouvez consulter notre sélection de thèmes WordPress les plus populaires pour obtenir des recommandations.
Si vous avez récemment inséré des extraits de code sur votre site web, il se peut que des erreurs dans le code soient à l’origine des erreurs 404. Examinez attentivement le code que vous avez ajouté et voyez si vous pouvez identifier des erreurs.
Le moyen le plus sûr d’ajouter des extraits de code à WordPress est le plugin WPCode. Ce plugin vous permet d’insérer du code personnalisé sans travailler directement avec les fichiers du thème, ce qui réduit le risque de briser votre site web.
De plus, lorsque WPCode détecte une erreur dans votre code, il désactive automatiquement l’extrait et vous demande de le vérifier. Vous pouvez également utiliser le mode de test pour vérifier que votre code fonctionne avant de le transférer sur votre site web.
Si aucune de ces solutions ne fonctionne, passez à la méthode suivante, qui vous permettra de résoudre les problèmes liés aux paramètres des permaliens.
Méthode 2 : Corrigez les paramètres de votre Permalink
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 3 : 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 4 : 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 5 : Corriger les articles WordPress qui renvoient 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.
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.
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!
Jen says
So for me… I first deleted the WP Fastest Cache out of my Cpanel and THEN…I « bulk deactivated » all my plugins. Did a refresh…and it worked! Praise God!
Then I activated the plugins I still needed. So far so good.
Thanks so much!
WPBeginner Support says
Thanks for sharing what worked for you
Administrateur
nebiyu amde says
i have fixed it using the first method. but when i try to get back to my home page from other pages it’s showing me this error: Error establishing a database connection…how can i fix this
WPBeginner Support says
To fix that error, you would want to take a look at our guide here: https://www.wpbeginner.com/wp-tutorials/how-to-fix-the-error-establishing-a-database-connection-in-wordpress/
Administrateur
Zeke Yoder says
If the problem still persists, you might want to check to see if mod_security is active and causing issues.
I ran into this on a wordpress site hosted by Dreamhost and tried all of the options listed on this page before realizing this was my issue.
WPBeginner Support says
Thanks for sharing this should someone else run into the same issue
Administrateur
Ajit says
I’m still facing this issue.
WPBeginner Support says
If the methods in this article are not working then you would want to reach out to your hosting provider to see if the error could be caused on that end.
Administrateur
Bunmi says
Thank you.
I have tried deactivating my plugins; I am using theme twenty sixteen. But still, my pages keep loading « the page can’t be found » when I use the custom permalink. I have done the .htaccess, but nothing is working. The post and categories load fine, but pages won’t load unless I use the plain permalink, which is not advisable for SEO purposes.
Please help me.
WPBeginner Support says
You may want to check with your hosting provider if you haven’t done so already to see if it could be part of an error on their end.
Administrateur
Louis says
This did not work. .htaccess file is correct but nothing above helped. Still looking for a solution.
WPBeginner Support says
You may want to start with our troubleshooting guide here: https://www.wpbeginner.com/beginners-guide/beginners-guide-to-troubleshooting-wordpress-errors-step-by-step/
Administrateur
miguel says
hello, thanks for the post, great.
i have 404 error but cannot acces neither the site or the wordpress. how can you access wordpress admin to solve the problem??
WPBeginner Support says
You would use FTP to access your htaccess file for one option and if that does not work you would want to take a look at our tutorial here: https://www.wpbeginner.com/beginners-guide/beginners-guide-to-troubleshooting-wordpress-errors-step-by-step/
Administrateur
Rosy Allan says
THANK YOU SO MCUH! sorted
WPBeginner Support says
Glad our guide was able to help
Administrateur
Denise says
Awesome! Thanks!
WPBeginner Support says
You’re welcome
Administrateur
Lars says
thank you so much – how quick a fix !
WPBeginner Support says
Glad our guide could be helpful
Administrateur
Avikar says
Great info, works perfectly. Got me running again
WPBeginner Support says
Glad our recommendations could help
Administrateur
Vhan says
Thank you so much my site is back.
WPBeginner Support says
Glad our recommendations could help
Administrateur
Gabriel Waju says
this tips really helpful…thank you so much
WPBeginner Support says
Glad our recommendations are helpful
Administrateur
Theodora says
Please i cannot even access the admin area of my page,i also can’t load the page itself at all. What can i do to solve this?
WPBeginner Support says
It would depend on the error you are receiving, for a starting point you can go through our guide here: https://www.wpbeginner.com/beginners-guide/beginners-guide-to-troubleshooting-wordpress-errors-step-by-step/
Administrateur
sudhanshu says
Thanks. This been a great help
WPBeginner Support says
You’re welcome
Administrateur
Shahnawaz Ahmad says
When i am doing same thing and when i am clicking on Save Changes it also redirecting me to my website with 404 Error
WPBeginner Support says
You may want to reach out to your hosting provider to see if they are seeing any errors for your site on their end.
Administrateur
Victor Carlvin says
Came here at first, couldn’t see the solution in the post. Searched the internet for several hours, came back and decided to read the comment section, there I saw the solution to the issue.
A plugin caused it and once I deactivate, update and reactive it, works fine thereafter. Thank you
WPBeginner Support says
Thank you for letting us know what solved the issue for you in case anyone else runs into the problem
Administrateur
Christos says
Thank you, i was just getting ready to jump off the building
but your post saved me!
WPBeginner Support says
Glad our post could help solve the problem
Administrateur
Kurnia Sudiar says
Thankssss, it works !!!!! it solved my problem
WPBeginner Support says
Awesome, glad our guide was helpful
Administrateur
Fiona says
Hi
Thank you very much !
this article is really helpful and solved my problem .
WPBeginner Support says
Awesome, glad our article could help
Administrateur
chioma says
The permalink solution worked for me. Thanks so much
WPBeginner Support says
Glad our guide could help
Administrateur
ahmed s says
thanks.. i was very close to pulling my hair out. lol.. i was getting the 404 on all my portfolio pages. yikes. easy fix.
WPBeginner Support says
Glad our article could help
Administrateur
Derin says
I have tried to click the save button on setting>permalink on my wordpress admin but the problem still persists. I can’t seem to locate the .htaccess on my FTP login. I noticed someone commented about editing the front. I tried checking out the storefront editor, but because I am not a programmer, I am being careful not to cause more damage to the theme. Any help on how to resolve the « 404 Page Not Found » permalink problem. It started after a recent wordpress update.
WPBeginner Support says
If resaving the permalinks didn’t work you may want to go through our troubleshooting steps here: https://www.wpbeginner.com/beginners-guide/beginners-guide-to-troubleshooting-wordpress-errors-step-by-step/
Administrateur
Babajide Adepoju says
a plugin was the problem for me; I deactivated it and had to edit the page somehow. It wasn’t that nice but it worked.
WPBeginner Support says
Thanks for sharing what solved your problem
Administrateur
Gary Leigh says
Thanks. This really helped and saved me a lot of stress.
WPBeginner Support says
Glad our guide could help
Administrateur
Charles D says
Just have to smile, as I am not the only delighted person. Saved from 3 days of agony kept getting a broken link mydomain.com/’/menu/category
the /’/ was apparently not linking and your TIP on Go to Settings » Permalinks, and simply click on Save Changes button. worked like a charm cheers
WPBeginner Support says
Glad our tip could help
Administrateur
mark says
my issue not solve, 404 is returning when i am updating sub pages
WPBeginner Support says
You may want to reach out to your hosting provider to ensure there are no issues on the hosting’s end
Administrateur
Harry says
Perfect! You have saved me lots of time,
So let me just Thank You here
Cheers
WPBeginner Support says
You’re welcome
Administrateur
Claudiu says
You are magic:)
WPBeginner Support says
Thank you
Administrateur
Moussa says
Thanks the first method works fine for me
WPBeginner Support says
Glad our guide could help
Administrateur
godfrey says
After trying everything stated to solve error 404 and couldn’t I decide to edit with front editor and save, vola it started working again.
WPBeginner Support says
Thanks for sharing what solved the issue for you
Administrateur
Qadir Amin says
I have applied all tricks like
Changed Permalinks
Changed Theme
Changed plugins
but all in vain, how can i resolve my this error?
WPBeginner Support says
If you recreated the htaccess file you may want to reach out to your hosting provider to ensure there are no errors on the host’s end
Administrateur
Dave says
The 404 error has been haunting me for last 3 days now, my problem is that I cannot access anything, no WP dashboard, no website, no cPanel, it’s turning out to be quite a disaster please help me fix this
WPBeginner Support says
For a 404 on everything, you would want to start by reaching out to your hosting provider for what they see on their end.
Administrateur
dave says
do you service any word press sites? i need help.
WPBeginner Support says
Unless I hear otherwise, we do not have a maintenance service but you can feel free to send us the issue you are running into using our contact form.
Administrateur
Reddemma says
i moved my local wordpress website to server.i changed composts table pointing to server ip and replaced all local host.changed config file and comoptions table also.
But menu links not working in server site.How can i fix this?
WPBeginner Support says
You may want to try recreating your menu to update the links.
Czarek says
Thank you very much! You save me with this solution
WPBeginner Support says
Glad our article could help
Administrateur
Rephin Perez says
Thanks so much !! You have saved my day. Didnt know that Saving the permanent links would fix this issue.
WPBeginner Support says
Glad our article could help
Administrateur
Decode Digital Market says
This post literally saved my life. I just had 404 error to all my posts.
All I had to do was save changes in permalinks and it worked.
WPBeginner Support says
Glad our article could help
Administrateur
Carmen says
Thank you so much for the information, unfortunately I am still having issues. When I try to click into +Add New Page it takes me to a 404, if I click +Add New Plugin it also takes me to a 404, if I try to add anything new it will take me to a 404, my website is still in the creation process, it is not yet published. I tried to use filezilla, but after multiple attempts doesn’t connect to my file. Do you know what I should do, I would greatly appreciate your answer!
WPBeginner Support says
You may want to reach out to your hosting provider to see if they have an error log on there end that points to the issue, your other option would be to go through the steps in: https://www.wpbeginner.com/beginners-guide/beginners-guide-to-troubleshooting-wordpress-errors-step-by-step/
Administrateur
alaa mohamed says
ok so am not sure if that’s the exact same issue am having. generally, when I access my website I don’t get any 404 errors yet on my SEO audit tool it is shown that my WordPress posts preview page is coming back with a 404 error, can anyone help me get this fixed ??
WPBeginner Support says
You would want to reach out to the support for your SEO tool to see if this is a known issue with the tool
Administrateur
Mathukutty P V says
Today enabled minify script/styles in swift performance lite and after that except home page all other links showed 404 error. searched and found this post and on checking found .htaccess empty, added the basic code from this post and 404 error gone. All links are working fine Thanks.
WPBeginner Support says
Glad our article could help
Administrateur
jeremy says
please help me out
i dont know whats wrong with my WordPress website, i tried creating a new post when am done, i click on publish but it redirect me to a page not found which 404, please help me out as at now, i cant publish anything on my site nothing is working,
thanks for your help in advance.
WPBeginner Support says
To start with you would want to go through our troubleshooting steps here: https://www.wpbeginner.com/beginners-guide/beginners-guide-to-troubleshooting-wordpress-errors-step-by-step/
If none of those steps work, if you reach out to your hosting provider they may have an error log that can point to the reason for the 404 error.
Administrateur
Alexander Londono says
you just save me a lot of time.
it had take me 2 hours with no solution
WPBeginner Support says
Glad our article could help
Administrateur
Ahmad WABBI says
This is a great post. I had a problem with the permalinks when I moved my WP site from a server to another. Your post saved me a lot of time searching for the reason.
Thanks
WPBeginner Support says
Glad our article could help
Administrateur
Babar Waheed says
hi
your all articles are easy to understand step by step with screen shots guide thanks for writing
I have a free classified website in word press. advertisers are posting ads in my website but few of them not meet with our terms and conditions so we delete those ads when i delete ads i get a message by word press.
(You just trashed a Post. Search engines and other websites can still send traffic to your deleted post. You should create a redirect to ensure your visitors do not get a 404 error when they click on the no longer working URL. With Yoast SEO Premium, you can easily create such redirects)
My question is how to fix this problem without buying yoast seo premium?
WPBeginner Support says
You can manually redirect the 404s using the method in our article here: https://www.wpbeginner.com/plugins/how-to-track-404-pages-and-redirect-them-in-wordpress/
Administrateur
Priya says
Hello,
My website is under construction right now.
But I still receive 404 error while logging in.
It does not allow me to open my account on wordpress as error arrives immediately after clicking on the log in button.
How to solve this problem so that I can assess wp to complete my website?
Plz give me directions so that I can proceed further as soon as possible.
Thank you!
WPBeginner Support says
It would depend on the specific error message but for a starting point you could try the steps in: https://www.wpbeginner.com/beginners-guide/beginners-guide-to-troubleshooting-wordpress-errors-step-by-step/
Administrateur
Baba nee says
Good day, i installed a pluggin. So i can put the google addsense script to my the head section of my blog, after putting this code to the pluggin and updating my permalinks i saved it. It still telling me page not found! How do i fix the error! Is there any other way i can insert this script manually via my cpanel! Please help a brother who is so confused right now
WPBeginner Support says
You can take a look at our Adsense guide for how to add the code here: https://www.wpbeginner.com/beginners-guide/how-to-add-google-adsense-to-your-wordpress-site/
Administrateur
Sapna says
These steps seem so simple. But I tried everything. Changing the rights to 666 and 664. Deleting the .htaccess file. Copying and pasting the code didn’t help either.
I even changed the permalink settings to which I desire and rewrite all the pages by hand again. To make sure they get the name I want and to have new page id’s
I tried literally everything. I’m really clueless now. Can you please help me.
WPBeginner Support says
To start, if those methods did not work, you would want to go through the general troubleshooting steps in our article here: https://www.wpbeginner.com/beginners-guide/beginners-guide-to-troubleshooting-wordpress-errors-step-by-step/
Administrateur
Dasuni says
Fatal error: Class ‘Email_Before_Download_Form’ not found in /wp-content/plugins/email-before-download/includes/class-email-before-download-shortcode.php on line 65
Why???
WPBeginner Support says
Your email before download plugin appears to be having an error, you would want to reach out to the plugin’s support to fix the error with the plugin. For being able to log into your site you should be able to log in once you disable the plugin: https://www.wpbeginner.com/plugins/how-to-deactivate-all-plugins-when-not-able-to-access-wp-admin/
Administrateur
Darshan Tejani says
Hi. I liked the simplicity in the Tutorial. Sadly, it didn’t work for me!
The error goes away only If I change my permalink to ‘plain’. If I change back permalink to ‘post name’, then it shows the error! I’d be grateful If you’d help me out here. Thanks anyway for the post.
WPBeginner Support says
If recreating the htaccess method is not working then you would want to reach out to your hosting provider to see if the mod_rewrite rule is enabled on their server.
Administrateur
Jasmine Martin says
thank you!
WPBeginner Support says
You’re welcome
Administrateur