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.
Abs
It helps.. just on permalink, already fix my error..
Thanks for this article..
Julius
Mine is a little different. All the pages are working fine but I get “page not found” when working in some places in the dashboard. Let’s say for example I’m creating a new page from the dashboard. When I click on publish I get a 404 error.
And I’ve tried everything above but it’s not working.
Iron65
Thanks for the tip!! the permalink really saved me!!! In case if any other suffered this by updating Yoast SEO or by just deleting cache, try that one, it will fix it
Monica
I have been trying to fix this permalink issue in my site for months and now I did it with your instructions. I don’t know why I did everything you said already and after writing the 644 permissions to fix the httaccess file, it went back to non-writeable. Now I did it and fixed the permissions and wrote your code and it worked. i really don’t know which was the difference but this time it did. Maybe that I already fixed the httaccess in the original folder where I have a subfolder with my blog. That is the only thing I did differently. Thanks a lot
Rais Dar
I am getting a 404(page not found) on my site. What should i do as i tried your methods but still error persists
Chetan
I had faced the same kind of problem. I used to get 404 Page Not Found error for a page. But the reason was that I and used a permalink slug that was associated with some default page in WordPress. e.g. http://example.com/posts – This is WRONG. Because I cannot use ‘posts’ as permalink slug. It is already reserved for some WordPress page. When I changed it to ‘my-posts’, so that now my permalink read: http://example.com/my-posts, the error was gone!
md
hi ,
i had same htaccess .,however , i delete it and import new one but still same .
dumb
hay guys ….
when i change the permalink to anything other than default, my pages wont work i get this error message
“The requested URL /wordpress/home/ was not found on this server.
Apache/2.4.9 (Win64) PHP/5.5.12 Server at localhost Port 80”
pl help me out
Ian Scofield
I just had this with one of my websites. All of my posts worked fine except for one though. Something was bad about the URL. I had to change the post URL.
neelesh
thanks a lot… ur website has helped me a lot of times and u guys are doing great job. i cant resist myself from thanking you…..
Hardik
Hi Wpbeginner,
Actually I just have migrated from hostinger to one of paid hosting. After migration all things are going good. But when I have tried to edit one my post it regularly shows the following error.
“Page not found error” ‘Apologies, but the page you requested could not be found. Perhaps searching will help.
When I have landed here I have tried all the solutions which you have share.
But nothing is working for me.
Please Help.
Thanks in advance
Hardik
Adrienne
Question? I have an url site, but the data is all new. so there are about 100 old posts that are not longer valid but linked to other sites.. How do I change it to forward to main website, so that Google Search Console can update they crawl records.
I’m looking, but I don’t see anything for posts that have been deleted and getting a 404 error.
Thanks,
David
Thanks was having exactly that issue and this fixed it perfectly!
Mark
Thank you! So nice to find such an easy fix for such a frustrating mysterious problem.
Xavier
Woohoo! Thanks for this. I thought my site content had gone to the birds. Doing the permalink “Save Changes” worked instantly for me.
Pablo
What if it doesn’t work no matter what you do?
HELP!
Fida
Hi Pablo Which server do you use? Shared server or VPS?
Steve Jackson
Thank you for this tip, it was a lifesaver and worked perfectly!
John
Thank you !!!!
abhishek
thank you very much it saved my links pretty well
Hugo Nascimento
Hello guys,
I have the same issue with a client blog. i’m trying to build a custom form inside post page and when I enable the custom permalinks, the form cannot be accessed.
When I change permalinks to default, it works out! :/
Really strange. :/
Sarah
Changing permalinks to default solved my problem too! Thank you!
mojamalenkost
Thank you so much!!!
victor
I have this problem .I can’t login to my WordPress dashboard, each time I try to it keeps giving me Error 404 not found. please help me fix this.
Dont Ask Real Name
Your tip was a life saver. All our posts were just not visible. Your tip helped a lot.
What i did:
Updated .htaccess set CHMOD to 666 instead of 660
Clicked – > Settings -> Permalinks
Clicked on Defaults and clicked Save Changes
Again,
Clicked on Post name and clicked on Save Changes. (since i used custom url that’s why)
You just saved me a ton of headache…
Clive Wales
That was a real life-saver – thought I’d totally screwed up a replacement site I’ve been working on, after trying to be clever with an .htaccess redirection. Thank you!
Marko Liuksiala
Great, that worked – thank you!!
Bill
I like the permalink structure of my posts and they seem to work. I have been using the same structure for several years.
However when I go to Settings–>Permalinks the actual structure is not even listed as one of the options available anymore.
Is this a problem?
Emily
Hi I am having this problem and to be honest, I feel sick because I don’t know what to do. I am a novice really and scared I am going to kill my website more than I already have.
Can someone please tell me what my custom permalink should look like and what I SHOULD hav in my .htaacess file? Right now it seems blank?
WPBeginner Support
Go to Settings » Permalinks choose a permalink structure that you like and then save your changes. Open your .htaccess file and you will notice that WordPress has automatically updated it. If it is blank and your chosen permalink structure is not working, then you can manually add this code into your .htaccess file:
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
Admin
Viktor
Yes, that was the solution! Thanks a lot. My hosting service changed these settings as I changed the URL to custom error pages but just clicking on the permalink settings fixed that.
Matthew Shelton
“Go to Settings » Permalinks, and simply click on Save Changes button” – fantastic, that worked right away – thanks a lot!!
WPBeginner Staff
Check the .htaccess file.
Gretchen Louise
What about for a single post permalink that got changed and somehow created an internal redirect, and now it cannot be changed back without creating a 404 error? Trying to troubleshoot an issue for a client and wondering where those internal redirects are stored and where in the world to clear them. Thank you.
Thembi Ngema
Dudessss. You guys are legends :)…. Must say I have learnt a lot from you in the past week
bhupendra
hi
thanks I just updated parmalinks structure and site started working
Arpee Lazaro
i just updated t he permalink structures are pictured in this solution and it worked like a charm. thanks!
WPBeginner Staff
Please contact your web host.
Attiq Haroon
I tried the solutions you mentioned in you post bhut it didn’t seems to be working. What happened actually is that I wanted to add a rule to .htaccess file so I downloaded that files from FTP and edited it and uploaded that file again replacing the original one, and then the problem popped up. I have tried a couple of fixes such as deleting and putting new .htacces with default code, removing .htacces file, etc. The only fix that is making the posts accessible is to set the permalink to default option. This makes the posts to work but it can not be a permanent Fix as it is not recommended as an SEO prespective
Please try to find a working solution on that problem
WPBeginner Staff
backup your .htaccess file. Then delete the one from your server. Now log into WordPress admin area and go to Settings -> Permalinks choose your desired permalink structure and hit save changes.
After that connect to FTP and see if WordPress has created a new .htaccess file and it is not blank.
Attiq Haroon
I tried that solution, It created a .htaccess file which looks fine but doesn’t work.
gui
If you have Yoast WordPress SEO or any SEO plugin installed, check your SEO permalink section…
Tim Topham
Hey guys – I recently received an email from Google crawl as I suddenly had a heap 500+ of lost links. It seems that at some stage I must have changed the permalink structure so that lots of the links on old posts have the post date and then post name where as they now just have the post name.
Before I go mad trying to fix 500 links in my articles manually, is there an easy way to update the hyperlinks in articles when this sort of thing happens?
Cheers,
Tim.
Manuel Moreira
I was going insane with this 404 thing after a server move. Thanks for the help guys.
Cindy
thank you! My sites were hacked and all internal pages showed a 404 error. saving the permalink settings fixed it! cheers!
Joe Cutroni
Hi all, I’ve scoured the web to find help to resolve my issue, but
for the life of me cannot get anything to work. Starting just a couple
of weeks ago, all of my back end pages (home page was fine) started
turning out 404 errors on them.
The permalink that I have always used is “Custom structure” (/%category%/%postname%/)…here are some things that I’ve tried:
1 . Gone into my permalinks, clicked “save settings”, and that method provides a temporary fix, maybe for an hour or two, then the 404 errors return on all secondary pages. I’ve also set my permalinks to a different option, such as “Default”, but still get 404 errors shortly after.
2. Completely deleted my htaccess.php file, then went back and saved permalink settings…less than an hour later, 404 errors returned.
3. Commented out this line of code in my function.php file, also completely removed it altogether:
“$wp_rewrite->flush_rules();”. That didn’t do anything. I’ve tried
using both “//” and “#” before it and tested…still get 404 errors.
4. De-activated all of my plugins to see it one of them was the culprit,
but after a short time, my 404 errors resumed while none of the plugins were active.
Like I said, this issue just start a few weeks ago. I use Securi
Security and had them scan my site for any malware, etc…and the site
is clean.
Can someone PLEASE help me with this? Would bigtime appreciate it!
Kyle
Hey Joe,
Did you ever find a workable solution for this? I’ve gone through the same issues that you listed.
David
Hey Guys!
Did you find a solution to the returning 404-error as listed above by JOE CUTRONI?
I’m dealing with the same issue?
Some Feedback would be awesome!
Thank you!
Greetings from Germany,
David
Paul
Hey guys,
you are likely to have a virus on your site.
good luck
Paul
Katie
This is the problem I am having. I moved from Wordpress.com to .org and I am at my wits end. I understand the directions that say got admin—> settings —> permalinks. In fact, I remember when I was setting this up that I messed with that particular setting. Here’s my issues: WHERE do I find this admin–> settings–> permalinks?? Is it on my host, in the cpanel? Is it back on WP.com, or if it’s WP.org? And if it’s on WP.org I don’t have a clue how to get to all the admin features of my blog now. When I log in, it shows me my personal profile and allows me to edit it. But not any blog administration. I am at a loss and really losing my head.
Gabriel
If I’m understanding you correctly, just type in the domain name that you activated the wp.org tool and follow it up with “/wp-admin” (for instance “www.example.com/wp-admin”)log in and on the lower left hand side you would find the settings option.
mali suresh
how can change localhost paramalink step by step help me
Srihari K
I had the same problem.. adding the below line in httpd.conf and restarting apache fixed it.
Options +FollowSymLinks
Kym Penrose Clayton
Thank you thank you thank you
Iris Fritschi-Cussens
THANK YOU from the bottom of my heart! I had to delete my .htaccess file due to a hack and then just when I thought everything was fine again nothing worked apart from the home page. Pressing Save Changes on the permalinks solved it in one.
disqus_Hct2NXneXJ
Thanks Man. The Permalink Solution Fixed my Problem. Thanks & Cheers for You!
MEMEME
Thanks! You are God.
L
thanks! I was close to panic…
Thai
Thanks for the post! But sadly I tried these with on the local and nothing worked.. Any other tips?
SemLavana
Thank you. Saved my weekend!