We’ve had moments where everything looked fine in WordPress, but the post link showed a 404 error instead. No changes to the content — just a missing page that should have been there.
This usually pops up after tweaking settings, switching themes, or adding code that silently affects permalinks. It can catch you off guard, especially if the rest of your site is working perfectly.
Whenever we run into unexpected 404 errors, we follow a simple process to get the post URLs back on track — no guesswork, no heavy troubleshooting. And that’s exactly what we’re sharing with you in this guide.
You’ll be able to fix the 404 errors and make sure your posts are loading the way they should.

Why Are My WordPress Posts Returning a 404 Error?
There are several reasons why your posts might be showing a 404 “Page Not Found” error in WordPress. These can include:
- Plugin or theme conflicts: Sometimes, plugins or themes you’ve installed on your site can interfere with how WordPress handles permalinks. This can lead to broken links and 404 errors.
- Custom code issues: If you’ve added custom code to your website, there might be errors in the code that are affecting permalinks or causing other conflicts, resulting in 404 errors for your posts.
- Issues with your .htaccess file: The .htaccess file plays a role in how WordPress structures URLs. If this file is corrupted or missing, it can lead to 404 errors for your posts or pages.
How to Find All WordPress Posts With 404 Errors
Before we get to the solutions, it’d be good to figure out if this error is just happening to one or two posts or multiple posts. This way, you can determine the scope of the problem and choose the most appropriate solution.
One easy way to figure this out is to use Google Search Console. If you haven’t submitted your site to Google Search Console already, then read our guide on how to add your WordPress site to Google Search Console.
Once the Google bot has crawled and indexed your site, Google Search Console will then provide you with detailed information about your site’s performance, including any 404 errors it encounters.
To find out which posts are returning 404 errors, you can log in to the Search Console dashboard. Then, navigate to the ‘Pages’ report, and you will see a detailed list of all the errors.

For more information, you can read our list of tips for using Google Search Console to grow website traffic, which includes some tips on how to fix 404 errors with the tool.
That being said, let’s look at how to fix WordPress posts returning 404 errors. You can use the links below to jump straight to different solutions:
- Method 1: Check for Plugin or Theme Conflicts and Custom Code Issues
- Method 2: Fix Your Permalink Settings
- Method 3: Update the WordPress .htaccess File
- Method 4: Contact Your Hosting Provider
- Method 5: Enable mod-rewrite (Local WordPress Installation)
- Frequently Asked Questions About WordPress 404 Errors
- 🎁 Bonus: Additional Guide on Handing 404 Errors
No time to fix 404 errors yourself? WPBeginner Pro Services can help! With our affordable Emergency WordPress Support, you can hire experts to fix 404 errors, broken links, redirect issues, and much more. Stop stressing over WordPress issues and get them fixed! Schedule Emergency WordPress Support Services today!
Method 1: Check for Plugin or Theme Conflicts and Custom Code Issues
Sometimes, plugins, themes, or custom code you’ve added to your WordPress website can interfere with permalinks or cause conflicts, leading to 404 errors. We’ve even experienced it ourselves when we’re testing tools on our demo site.
One way to solve this problem is to temporarily deactivate plugins. Plugins can sometimes disrupt how WordPress handles links.
Once you’ve deactivated the plugins, you can reactivate them one by one while checking if the 404 error reappears after activating each plugin. If the error shows up after activating a specific plugin, that might be the culprit.
You can then do a quick Google search for solutions related to that plugin or contact the plugin developer for support.
Similarly, your WordPress theme might be causing the conflict.
To check, you can temporarily switch to a default WordPress theme like Twenty Twenty-Three or Twenty Twenty-Four. All you need to do is go to Appearance » Themes and click ‘Activate’ on a default theme.

If the 404 error disappears with the default theme, it indicates a potential conflict with your current theme. You can then try troubleshooting the theme or consider using a different theme.
You can check out our expert pick of the most popular WordPress themes for recommendations.
If you’ve recently inserted code snippets to your website, there might be errors in the code causing the 404 errors. Take a close look at the code you added and see if you can identify any mistakes.
The safest way to add code snippets to WordPress is with the WPCode plugin. This plugin lets you insert custom code without directly working with the theme files, reducing the risk of breaking your website.
Plus, whenever WPCode spots an error in your code, it will automatically deactivate the snippet and ask you to check it. You can also use the testing mode to check if your code works before pushing it to your live website.

If none of these solutions work, move on to the next method where we’ll troubleshoot your permalink settings.
Method 2: Fix Your Permalink Settings
WordPress posts can return 404 errors because of problems with rewrite rules in your .htaccess file. In most cases, you can fix the problem by updating your permalink settings.
Simply go to Settings » Permalinks in your WordPress admin, and click on the ‘Save Changes’ button.

There is no need to make changes to the permalink settings themselves. This will update your permalink settings and flush the 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.
Method 3: Update the WordPress .htaccess File
Before you start, make sure to back up your WordPress .htaccess file first. If something goes wrong, you can easily restore the original file.
Now, you’ll need to connect to your server using an FTP client like FileZilla or the File Manager in your hosting control panel.
Next, find the .htaccess file in your site’s root folder—this is the same directory that contains folders like /wp-content/
and /wp-includes/
.
Right-click on the file and select ‘File permissions’ or ‘Change permissions’ from your FTP client.

If WordPress couldn’t write to the file before, try changing its permissions temporarily to 666 to make it writable.
After that, go back to your WordPress admin area and resave your permalink settings. This allows WordPress to regenerate a proper .htaccess file.
Once that’s done, make sure to change the file permissions back to a more secure setting: 644. This setting allows WordPress to read the file, while still protecting it from unauthorized changes.

Alternatively, you can manually edit the file.
Simply right-click on the .htacccess file and then select View/Edit option.

The file will open in plain text editor like Notepad or TextEdit.
Now you need to add the following default WordPress rewrite rules:
# 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
Method 4: Contact Your Hosting Provider
If neither of the solutions above has fixed the WordPress posts returning 404 error, then we recommend contacting your WordPress hosting provider. There may be an error on their end, or they might be able to help you troubleshoot the problem.
Please also see our guide on how to properly ask for WordPress support and get it.
Method 5: Enable mod-rewrite (Local WordPress Installation)
If you are using a local server for testing purposes, then you will need to enable mod_rewrite in the Apache configuration of your MAMP, WAMP, or XAMPP site.
This will allow WordPress to generate clean URLs and prevent the 404 error for posts and pages on your local server.
How you do this will differ by the platform you use. People using XAMPP can open their control panel and click the ‘Config’ button within Actions. Then, select ‘Apache (httpd.conf).’

Next, you will need to find this line #LoadModule rewrite_module modules/mod_rewrite.so
and remove the ‘#’ to uncomment it.
This will load the mod_rewrite.

Then, look for lines that say AllowOverride None
and change them to AllowOverride All
. This tells Apache to allow the use of .htaccess
files.
You’ll typically find these inside <Directory>
blocks—especially the one pointing to your site’s folder, like htdocs
if you’re using XAMPP. If you’re unsure, it’s okay to apply the change wherever you see it inside the file, as long as it’s not a system directory. For local testing, this usually works just fine.

Once done, you can save the httpd.conf file and close it. After that, in the XAMPP control panel, click ‘Stop’ on the Apache module and ‘Start’ again to restart it.
Then, go back to your admin dashboard to see if your permalinks are working.
Video Tutorial
If you need visual instructions, then just watch the video below.
Frequently Asked Questions About WordPress 404 Errors
Encountering 404 errors on your WordPress site can be confusing. Below, we’ve answered common questions that can help you troubleshoot and fix the issue more effectively.
1. Why am I getting a 404 error on my WordPress posts?
This usually means WordPress can’t find the post at the requested URL. It can happen due to broken permalinks, a corrupted .htaccess file, deleted posts, or a plugin/theme conflict that changes how URLs are handled.
2. How do I fix a 404 error in WordPress?
Try resaving your permalink settings by going to Settings » Permalinks and clicking ‘Save Changes’. If that doesn’t work, check your .htaccess file, disable plugins, or switch to a default theme to rule out conflicts.
3. How can I find all 404 errors on my WordPress site?
You can use Google Search Console to see a list of 404 errors Googlebot encounters. Plugins like Broken Link Checker can also help spot broken links and missing pages inside your site.
4. What does the .htaccess file do in WordPress?
The .htaccess file controls how URLs are processed. WordPress uses it to manage permalink structure and route URLs to the correct content. If it’s missing or corrupted, URLs may stop working correctly.
5. How do I safely edit the .htaccess file?
You can edit it using an FTP client or your hosting file manager. Always back it up first. After editing, make sure the permissions are set to 644 so it stays readable and secure.
6. Why do my WordPress category or tag pages show 404 errors?
This can happen if your theme doesn’t support archive templates, or if permalink settings are misconfigured. Resaving permalinks and checking your theme’s archive support can help fix it.
7. How do I fix 404 errors for custom post types?
Visit Settings » Permalinks and click ‘Save Changes’ to refresh rewrite rules. Also, check that your custom post type is registered with the right rewrite settings and has archive support if needed.
8. Can I redirect 404 pages to my homepage or another page?
Yes, plugins like Redirection let you create 301 redirects from old or broken URLs to new ones. You can also create a custom 404 page to guide users back to useful content.
🎁 Bonus: Additional Guide on Handing 404 Errors
You may also find the following resources helpful in managing 404 and other common WordPress errors.
- How to Improve Your 404 Page Template in WordPress (2 Ways)
- Best WordPress 404 Error Page Design Examples
- Best Free 404 Redirect Plugins for WordPress
- How to Get Email Alerts for 404 Errors in WordPress
We hope this article helped you resolve the posts returning 404 errors in WordPress. You may also want to see our guide to the most common WordPress errors and how to fix them, along with our expert picks for the best WordPress plugins to grow your 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.
Nweke Nathaniel
I unpublished some posts from my site and I have linked some internal links to the posts, pls, how can I redirect the posts url to the homepage instead of showing “page not found”
WPBeginner Comments
The simplest solution likely would be to redirect all 404 errors to the homepage. To do this, check out this step-by-step guide: https://www.wpbeginner.com/wp-tutorials/how-to-redirect-your-404-page-to-the-home-page-in-wordpress/
Dayo Olobayo
I get the 404 error on posts I have deleted and do not wish to redirect them to other articles. How do I solve that?
WPBeginner Support
In that case you would want to redirect the posts to your homepage as that URL would show a 404 error if there is nothing to show.
Admin
Dayo Olobayo
This looks so simple yet very helpful. I’ve never even considered that alternative before. I’ll do that right away. Thanks a million!
Moinuddin Waheed
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
Glad we could share the other options
Admin
mohadese esmaeeli
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
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
Thank you for sharing this suggestion to check for multiple htaccess files.
Admin
Eriab Nsereko
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
Glad we could help!
Admin
David Helleskov Fønsbo
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
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.
Admin
Victor
The updating permalinks fix worked. Fastest solution ever. Thank you for writing this piece
WPBeginner Support
You’re welcome, glad our guide was helpful!
Admin
Julie
Thank you for the quick fix! Appreciate the help.
WPBeginner Support
You’re welcome, glad our guide could help you!
Admin
Frank Thomas
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
You’re welcome, glad to hear the guide helped!
Admin
anand
i have try to your guideline but not working my website again showing same error 404
WPBeginner Support
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!
Admin
Harald
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
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
Thank you very much.solved my problem
WPBeginner Support
Glad our guide was helpful!
Admin
Emmanuel
This is my lifesaver. My site is working fine after modifying the .htaccess files.
Thanks a ton!
WPBeginner Support
Glad our guide could help!
Admin
Jon
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
Thanks for sharing this for those who may also have this issue!
Admin
Mario Nwolisah
Thank you! It worked. I really appreciate.
WPBeginner Support
Glad our article was helpful!
Admin
Jess
Thank you – this saved me!
WPBeginner Support
Happy to hear our guide could help!
Admin
Cristian
Thank you, it works for me!!!
WPBeginner Support
Glad our recommendations were able to assist!
Admin
Samir K Al Busaidy
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
Glad our guide was able to help
Admin
Udaykumar Posia
This worked. Thank you so much.
WPBeginner Support
Glad our guide could help
Admin
Max Legault
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
Glad you were able to find the solution for your issue
Admin
Jonathan
Thanks, Max, none of the solutions here worked and I’m on IIS as well. I changed my permalinks from post name to plain and it worked.
Collin
I love you for this! This was an easy fix. I was in full panic mode!
WPBeginner Support
Glad our guide was able to help
Admin
Zack
Thank you so much. It worked!
WPBeginner Support
Glad our guide was helpful
Admin
Steve Barnard
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
Glad our guide could help
Admin
A.S.M. Arifur Rahman
Thanks a lot, settings saved method works, Now my post open fine.
kris
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
This article just saved me from a panic attack Lol. The solution worked great. Thanks for making this video.
Muhammad Tahir
i didn’t solve this issue by using all the methods that you are discussed?
WPBeginner Support
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
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
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
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
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
Glad our guide was able to help
Admin
Islombek
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
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
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
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
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
Glad our guide was helpful
Admin
Rick
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
Glad our guide was helpful
Admin
Elroy
Thanks a lot Wpbeginner it woked just fine.
WPBeginner Support
Glad our guide was helpful
Admin
Noble
Thank you very much, it worked instantaneously!
WPBeginner Support
Glad our guide could help
Admin
carol hannah
Help! It didn’t work and I can’t possibly work out how to do the .htaccessfile thingy?
WPBeginner Support
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
Thank you, thank you, thank you!
WPBeginner Support
Glad our guide was helpful
Admin
Dan
Man this fixed my WP site! THANK YOU!
WPBeginner Support
Glad our guide was helpful
Admin
Molly
Thank you for a million time!!!!!
WPBeginner Support
Glad our guide was helpful
Admin
Amin Omer
Thank you very much
WPBeginner Support
You’re welcome
Admin
Afan
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
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
Saving the permalinks settings worked perfectly. Such a simple solution to what looked like a serious problem! Thank you!
WPBeginner Support
Glad our recommendation was helpful
Admin
mukhtar
its works fine 100 %
and easy to solve my problem, we are very very thankful to you about it
WPBeginner Support
Glad our guide was helpful
Admin
Sarah
Wow!! I’ve spent all evening trying to fix this and that’s how easy it was! THANK YOU!!
WPBeginner Support
Glad our guide was helpful
Admin
Rimzan farook
Thanks fixed it as you described changed my post date to post name, thanks a ton
WPBeginner Support
Glad our recommendations could help
Admin
Muhammad Zeeshan
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
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
I’m having error 404 issues on my website, I can’t access to the website at all what can I do?
WPBeginner Support
You would use the htaccess method from this guide or reach out to your hosting provider to be able to assist you
Admin
samith
I can’t login my WP dashboard seen “nginx 404 not found error”
WPBeginner Support
For that specific error, you would want to reach out to your hosting provider to take a look.
Admin
Sammy
A BIG Thank You… It solved the headache!
WPBeginner Support
Glad our guide was helpful
Admin