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.
Thank you very much
You’re welcome
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…
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.
Saving the permalinks settings worked perfectly. Such a simple solution to what looked like a serious problem! Thank you!
Glad our recommendation was helpful
its works fine 100 %
and easy to solve my problem, we are very very thankful to you about it
Glad our guide was helpful
Wow!! I’ve spent all evening trying to fix this and that’s how easy it was! THANK YOU!!
Glad our guide was helpful
Thanks fixed it as you described changed my post date to post name, thanks a ton
Glad our recommendations could help
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.
You would want to reach out to your hosting provider to see if you are running into any errors on their server’s end.
I’m having error 404 issues on my website, I can’t access to the website at all what can I do?
You would use the htaccess method from this guide or reach out to your hosting provider to be able to assist you
I can’t login my WP dashboard seen “nginx 404 not found error”
For that specific error, you would want to reach out to your hosting provider to take a look.
A BIG Thank You… It solved the headache!
Glad our guide was helpful
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.
You would likely want to check under Settings>Permalinks to ensure everything is set correctly there
Thank you,
It solved my problem!
Glad our guide was helpful
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
Thanks for sharing what worked for you
thank you, that help a lot
You’re welcome
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.
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
My main page is working but all other pages are showing 404 error. They are visible in admin panel but can’t view them.
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/
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.”
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.
This worked beautifully. Thank you!
You’re welcome, glad it helped
Yes, WPBEGINNER rocks !!!!
Glad our guides were helpful
Crazy how helpful this article is. Such a simple solution to a very frustrating problem.
Glad we could help make the solution easy
This is very helpful thank you.
You’re welcome
I’m having the same problem with category links. They return a 404 error and it’s a new website. I’m afraid not all pages are going to be indexed.
This same solution should work, you may also want to take a look at our troubleshooting guide below:
https://www.wpbeginner.com/beginners-guide/beginners-guide-to-troubleshooting-wordpress-errors-step-by-step/
This was very helpful…
Glad our guide was helpful
Thanks, this was helpful for me.
Glad our guide was helpful
I just build my website. I was able to go into dashboard. I changed the url (IP address) to my domain. Now mydomain.com and mydomain.com/wp-admin give me “Not Found”.
Any suggestions? Thanks.
If your site is on your hosting provider you would want to reach out to your host’s support to ensure the site is in the correct location and your domain is pointing correctly.
Thank you very much for precious article that is useful to fixed my website problem.. i always prefer your web solution regarding in problem in wordpress cms.
Thank you..;.
You’re welcome, glad our guides have been helpful
Just wanted to leave a thank you comment! Your guides on WordPress are second to none! I have learnt so much reading your blog and every time I Google a problem..I am looking for your website and that is where I will click! Great and simple instructions even on the most complicated WordPress issues…you are awesome! Thanks.
You’re welcome, glad you like our content and hope our guides continue to be helpful
This totally worked! I just updated my PHP and dashboard and home pages was accessible but not any of my post pages.
Thx
You’re welcome, glad our guide was helpful
Thank You so much it saved my life! I had to move my WordPress website to a new server and it took me a whole day to fix everything. I wish WP had an easy way to do this.
Glad our guide was helpful, for transferring your content you would want to take a look at our article below:
https://www.wpbeginner.com/wp-tutorials/how-to-move-wordpress-to-a-new-host-or-server-with-no-downtime/
Thank you guys, you’re AWESOME, ALLWAYS!
You’re welcome
I tried everything in the article with no success. What I ended up doing was choosing a different Permalink structure and saving it, and then going back to the structure I wanted and saving it. Then all was well.
Thanks for sharing the method that worked for you
I accidentally deleted .htaccess file when doing 301 and got the 404 not found error. Your tutorial came to my rescue. Just by saving the permalinks and it worked. Thank you.
You’re welcome, glad our guide could help
Saved me! I am dealing with forces I cannot comprehend, and this explanation and tip was really helpful!
Glad our guide was helpful
Wow, I’m shocked at how fast this worked. I recently migrated my site from a subdomain to the root domain and none of my links were working. All I did was go to permalinks in settings and click “save changes.” That was all. Wow. And I was really scared I’d broken something. Thank you.
You’re welcome, glad we were able to help
What do you do if you cant even get into your WP
dashboard
For that, you would want to take a look at our article below:
https://www.wpbeginner.com/beginners-guide/beginners-guide-to-troubleshooting-wordpress-errors-step-by-step/
Hi, thanks for the tips. I still can’t seem to fix the error. Have reset Permalinks, installed a redirect plugin (doesn’t help if wanting to redirect to the homepage). I can’t work out how to alter the .htaccess and not really confident to do it. Any other suggestions?
If you are using a static page ensure it is published, for the htaccess you would need to use FTP or your host’s file manager, otherwise, you would want to follow our troubleshooting guide below:
https://www.wpbeginner.com/beginners-guide/beginners-guide-to-troubleshooting-wordpress-errors-step-by-step/
Thanks You saved me a lot of hassles
You’re welcome
THANK YOU for this post! I had a primary domain that I let go and needed to move two sites on my hosting plan…. 1 to the primary domain position and 1 to an addon domain position which was formerly a subdomain position. I broke a lot of stuff. With some logical thought, I got most of it all back… EXCEPT all the pages on the primary domain site couldn’t be viewed on the live site once you clicked on them or the menu links. The home page loaded beautifully, but when you clicked a post or link… the errors popped up. This trick resolved those issues… so THANK YOU again! You saved the day!
You’re welcome, glad our guide was helpful
I just change the permalink directly and it shows 404 error I couldn’t access my website it redirects me to another site which is not mine
You would want to reach out to your hosting provider to ensure your domain is set up properly and there isn’t any malicious code on your site.
404 Not Found
nginx/1.10.3 (Ubuntu)
please give me solution for that
For nginx, at the moment you would want to reach out to your hosting provider and they should be able to assist.
I’m busy building a website via wordpress & cpanel. I by accident deleted the url in my dashboard. Now I don’t get even access. Is their any way to fix it.
You would need to edit your site via phpMyAdmin similar to the article below. Instead of the users table you would need to edit the options table where you can readd your site address and url.
https://www.wpbeginner.com/beginners-guide/how-to-reset-a-wordpress-password-from-phpmyadmin/
Just want to let you know that you’ve helped me save a lot of time searching.
Thanks so much.
You’re welcome, glad our guide was able to help
OMG I LOVE YOU
updating the permalinks and all is gold
THANK YOU
Glad our guide was able to help
Updating permalinks fixed my 404 errors. Thanks!
You’re welcome
Updating the permalink worked perfectly. Thanks guys!
You’re welcome, glad our guide was helpful
thanks its is working
You’re welcome, glad our guide was helpful
Simply saving changes in my permalinks did the trick. Thank you!
You’re welcome, glad our guide was helpful
After saving changed for the permalink, it still returned the 404 error. Then I used the clear cache WP button at the top and the problem was solved.
Glad you were able to resolve the issue
Thank you so much !
You’re welcome
Thanks so much for this post. You are a lifesaver. Clicking ‘Save Changes’ on Permalinks under Settings did the job for me.
Glad our recommendation was able to help