WordPress is a powerful CMS. Sometimes a slight tweak can make your website inaccessible. However, finding a solution for any WordPress problem is extremely easy (check out how to properly ask for WordPress support and get it). In the past we have covered some of the most common problems WordPress users face. Like the internal server error or error establishing database connection. Another common problem that most WordPress users face at some point is WordPress posts returning a 404 Error. In this article we will show you how to fix WordPress posts returning 404 error.
Usually in this scenario a user can access their WordPress admin area, their blog’s main page, but when accessing a single posts they get a 404 Not found error. First of all, don’t panic most of the time your posts are still there and completely safe. This usually happens if your .htaccess file got deleted or something went wrong with the rewrite rules. What you need to do is fix your permalinks settings.
Video Tutorial
If you don’t like the video or need more instructions, then continue reading.
Go to Settings » Permalinks, and simply click on Save Changes button.
This will update your permalinks settings and flush rewrite rules. In most cases this solution fixes the WordPress posts 404 error. However, if it does not work for you, then you probably need to update your .htaccess file manually.
Login to your server using FTP, and modify the .htaccess file which is located in the same location where folders like /wp-content/ and /wp-includes/ are located. The easiest thing you can do is to temporarily make the file writeable by changing the permissions to 666. Then repeat the original solution. Don’t forget to change the permissions back to 660. You can also manually add this code in your .htaccess file:
# 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
Fix for Local Servers
Often designers and developers install WordPress on their computers using a local server for testing purposes. If you want to use pretty permalinks, then you need to enable the rewrite_module in the Apache configuration of your MAMP, WAMP, or XXAMP.
We hope this article helped you resolve posts returning 404 error in WordPress. Did this solution work for you? Do you have another solution that worked for you? Please share it in the comments below. We would like to make this article a comprehensive resource for users who run into this issue.
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.
Admin
Mete says
Thank you very much.solved my problem
WPBeginner Support says
Glad our guide was helpful!
Admin
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!
Admin
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!
Admin
Mario Nwolisah says
Thank you! It worked. I really appreciate.
WPBeginner Support says
Glad our article was helpful!
Admin
Jess says
Thank you – this saved me!
WPBeginner Support says
Happy to hear our guide could help!
Admin
Cristian says
Thank you, it works for me!!!
WPBeginner Support says
Glad our recommendations were able to assist!
Admin
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
Admin
Udaykumar Posia says
This worked. Thank you so much.
WPBeginner Support says
Glad our guide could help
Admin
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
Admin
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
Admin
Zack says
Thank you so much. It worked!
WPBeginner Support says
Glad our guide was helpful
Admin
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
Admin
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.
Admin
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
Admin
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
Admin
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/
Admin
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.
Admin
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
Admin
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
Admin
Elroy says
Thanks a lot Wpbeginner it woked just fine.
WPBeginner Support says
Glad our guide was helpful
Admin
Noble says
Thank you very much, it worked instantaneously!
WPBeginner Support says
Glad our guide could help
Admin
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.
Admin
Christopher Krohn says
Thank you, thank you, thank you!
WPBeginner Support says
Glad our guide was helpful
Admin
Dan says
Man this fixed my WP site! THANK YOU!
WPBeginner Support says
Glad our guide was helpful
Admin
Molly says
Thank you for a million time!!!!!
WPBeginner Support says
Glad our guide was helpful
Admin
Amin Omer says
Thank you very much
WPBeginner Support says
You’re welcome
Admin
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.
Admin
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
Admin
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
Admin
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
Admin
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
Admin
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.
Admin
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
Admin
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.
Admin
Sammy says
A BIG Thank You… It solved the headache!
WPBeginner Support says
Glad our guide was helpful
Admin
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
Admin
Daniel says
Thank you,
It solved my problem!
WPBeginner Support says
Glad our guide was helpful
Admin
Mellissa says
This is a great solution but it didn’t fix my issue so in case anyone else is in the same boat, here’s what went wrong for me; my index.php file went missing from the server. Added a new copy and everything is back
WPBeginner Support says
Thanks for sharing what worked for you
Admin
Brahim says
thank you, that help a lot
WPBeginner Support says
You’re welcome
Admin
Logan says
Thanks for your articles. My issue is that I can’t log in to my website even though I’m logged in to the host server… When I try to log in my wordpress the message goes :
Not Found
The requested URL was not found on this server.
My website isn’t published yet as I’ve just started.
WPBeginner Support says
You would want to check with your hosting provider to ensure there isn’t an issue on their end or where your site is installed
Admin
Danish says
My main page is working but all other pages are showing 404 error. They are visible in admin panel but can’t view them.
WPBeginner Support says
If the method from our guide above were unable to assist you, you would want to go through our troubleshooting steps below:
https://www.wpbeginner.com/beginners-guide/beginners-guide-to-troubleshooting-wordpress-errors-step-by-step/
Admin
Peck-Secia Tangi says
Hi,
Below is the error that i am getting which is similar to the one described above
“The requested URL was not found on this server.”
WPBeginner Support says
For that error, if you haven’t done so already you would want to reach out to your hosting provider to see if the error could be server related.
Admin
Kathryn says
This worked beautifully. Thank you!
WPBeginner Support says
You’re welcome, glad it helped
Admin
Parvinder Singh says
Yes, WPBEGINNER rocks !!!!
WPBeginner Support says
Glad our guides were helpful
Admin
clay says
Crazy how helpful this article is. Such a simple solution to a very frustrating problem.
WPBeginner Support says
Glad we could help make the solution easy
Admin
Shoeb Khan says
This is very helpful thank you.
WPBeginner Support says
You’re welcome
Admin