Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

How to Fix WordPress Posts Returning 404 Error (Step by Step)

There’s nothing quite as frustrating as clicking on a post you know exists—only to land on a 404 error page. We’ve run into this issue more than once, and it can feel confusing when nothing seems obviously broken.

The good news? In most cases, you can fix it in under a minute. Just go to Settings » Permalinks and click ‘Save Changes’—that simple step resolves the issue for the majority of WordPress sites.

If that doesn’t work, don’t worry. We’ve put together a step-by-step guide covering every common cause… from plugin conflicts to .htaccess issues so you can get your posts back online fast.

How to fix WordPress posts returning 404 error

Why Are My WordPress Posts Returning a 404 Error?

A 404 error means the server couldn’t find the page you requested—even though it may exist in your WordPress dashboard. This disconnect usually happens because something has broken the link between your post’s URL and its actual content.

Here are the most common reasons your posts might show a 404 “Page Not Found” error:

  • Plugin or theme conflicts: Some plugins or themes can interfere with how WordPress handles permalinks. This can lead to broken links and 404 errors on posts that were working fine before.
  • Custom code issues: If you’ve added custom code to your site, even a small error can affect permalinks or cause conflicts that result in 404 errors.
  • Problems with your .htaccess file: The .htaccess file controls how WordPress structures URLs. If this file is corrupted, missing, or misconfigured, your posts and pages may return 404 errors.

How to Find All WordPress Posts With 404 Errors

Before jumping into fixes, it helps to know if this error affects just one post or many. Understanding the scope makes it easier to choose the right solution.

We recommend using Google Search Console. If you haven’t set it up yet, see our guide on how to add your WordPress site to Google Search Console.

Once the Google bot has crawled your site, Search Console will show you detailed reports—including any 404 errors it finds.

To see which posts are returning errors, log in to your Search Console dashboard. Navigate to the ‘Pages’ report, and you’ll find a list of all flagged URLs.

Google Search Console Pages Report

For more help, check out our tips for using Google Search Console to grow website traffic, which includes advice on fixing 404 errors.

Now, let’s look at how to fix WordPress posts returning 404 errors. You can use the links below to jump to a specific method:

Method 1: Check for Plugin or Theme Conflicts and Custom Code Issues

Plugins, themes, or custom code can sometimes interfere with permalinks and cause 404 errors. We’ve run into this ourselves when testing tools on our demo sites.

When we troubleshoot, we use a staging environment to safely deactivate plugins one by one. This helps us isolate the problem without affecting the live site.

To try this yourself, start by temporarily deactivating all your plugins. Then reactivate them one at a time, checking after each one to see if the 404 error returns.

If the error appears after activating a specific plugin, that’s likely the cause. You can search for solutions related to that plugin or contact the developer for support.

Your WordPress theme could also be the issue.

To check, temporarily switch to a default WordPress theme like Twenty Twenty-Three or Twenty Twenty-Four. Go to Appearance » Themes and click ‘Activate’ on a default theme.

Activating a default WordPress theme

If the 404 error goes away with a default theme, your original theme is probably causing the conflict. You can troubleshoot it further or consider switching to a different theme.

For recommendations, check out our expert pick of the most popular WordPress themes.

If you’ve recently added code snippets to your website, review them carefully. Even small mistakes can cause 404 errors.

We recommend using the WPCode plugin for adding custom code. It lets you insert snippets without editing theme files directly, which reduces the risk of breaking your site.

WPCode also detects errors automatically. If something goes wrong, it deactivates the snippet and alerts you. You can even use testing mode to check your code before pushing it live.

WPCode error warning

If none of these steps fix the issue, move on to the next method where we’ll troubleshoot your permalink settings.

WordPress posts often return 404 errors because of problems with rewrite rules in your .htaccess file. In most cases, you can fix this by simply resaving your permalink settings.

Go to Settings » Permalinks in your WordPress admin and click the ‘Save Changes’ button.

Check Permalinks

You don’t need to change anything. Just clicking ‘Save Changes’ flushes the rewrite rules (meaning WordPress regenerates the URL routing instructions that tell your server where each post lives).

This simple step fixes the 404 error for most WordPress sites. If it doesn’t work for you, you may need to update your .htaccess file manually.

Method 3: Update the WordPress .htaccess File

Before making any changes, we recommend backing up your WordPress site and your .htaccess file. If something goes wrong, you can easily restore the original.

You’ll need to connect to your server using an FTP client like FileZilla, or use the File Manager in your hosting control panel.

Next, find the .htaccess file (a hidden configuration file that controls how your server handles URLs) 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.

.htaccess file permissions

If WordPress couldn’t write to the file before, try changing the permissions temporarily to 666 to make it writable.

Important: Permission 666 means anyone can read and write to the file, which is a security risk. Only use this setting temporarily and change it back immediately after you’re done.

Now, return to your WordPress admin and resave your permalink settings (Settings » Permalinks » Save Changes). This lets WordPress regenerate a proper .htaccess file.

Once that’s done, go back to your FTP client and change the file permissions to 644. This setting allows WordPress to read the file while protecting it from unauthorized changes.

Change file attributes for the .htaccess file to 644

Alternatively, you can edit the .htaccess file manually.

Right-click on the .htaccess file and select the View/Edit option.

Edit .htaccess file

The file will open in a plain text editor like Notepad or TextEdit.

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

Save the file and upload it back to your server. Then check if your posts are loading correctly.

Method 4: Contact Your Hosting Provider

If none of the solutions above have fixed the 404 error, we recommend contacting your WordPress hosting provider.

There may be a server-side issue on their end, or they can help you troubleshoot the problem further. In our experience, good hosting support teams can often spot configuration issues that are easy to miss.

For tips on getting help, see our guide on how to properly ask for WordPress support and get it.

Method 5: Enable mod-rewrite (Local WordPress Installation)

If you’re running WordPress on a local server for testing, you’ll need to enable mod_rewrite in your Apache configuration. This applies to MAMP, WAMP, or XAMPP setups.

Enabling mod_rewrite allows WordPress to generate clean URLs and prevents 404 errors on your local posts and pages.

The steps vary by platform. If you’re using XAMPP, open the control panel and click the ‘Config’ button in the Actions column. Then select ‘Apache (httpd.conf)’.

The Apache (httpd.conf) menu on XAMPP

Find this line: #LoadModule rewrite_module modules/mod_rewrite.so

Remove the ‘#’ at the beginning to uncomment it. This enables the mod_rewrite module.

Finding the rewrite_module on httpd.conf file

Next, look for lines that say AllowOverride None and change them to AllowOverride All. This tells Apache to allow .htaccess files to control URL routing.

You’ll typically find these inside <Directory> blocks, especially the one pointing to your site’s folder (like htdocs in XAMPP). For local testing, it’s usually safe to apply this change wherever you see it.

Changing AllowOverride None to AllowOverride All

Save the httpd.conf file and close it. In the XAMPP control panel, click ‘Stop’ on the Apache module, then click ‘Start’ again to restart it.

Now go back to your WordPress admin dashboard and check if your permalinks are working.

Video Tutorial

If you prefer visual instructions, watch the video below.

Subscribe to WPBeginner

Frequently Asked Questions About WordPress 404 Errors

Running into 404 errors on your WordPress site can be confusing. Here are answers to common questions that can help you troubleshoot more effectively.

Why am I getting a 404 error on my WordPress posts?

A 404 error on WordPress posts usually means the server can’t find the page at the requested URL. This can happen due to broken permalinks, a corrupted .htaccess file, deleted posts, or a plugin/theme conflict that changes how URLs are handled.

How do I fix a 404 error in WordPress?

The fastest way to fix a WordPress 404 error is to resave your permalink settings. Go to Settings » Permalinks and click ‘Save Changes’. If that doesn’t work, check your .htaccess file, disable plugins, or switch to a default theme to rule out conflicts.

How can I find all 404 errors on my WordPress site?

Google Search Console is the best way to find 404 errors on your WordPress site. It shows you a list of all 404 errors that Googlebot encounters. You can also use plugins like Broken Link Checker to spot broken links and missing pages.

What does the .htaccess file do in WordPress?

The .htaccess file in WordPress is a configuration file that controls how URLs are processed. WordPress uses it to manage permalink structure and route URLs to the correct content. If this file is missing or corrupted, your URLs may stop working correctly.

How do I safely edit the .htaccess file?

You can safely edit the .htaccess file using an FTP client or your hosting file manager. Always create a backup first. After editing, make sure the permissions are set to 644 so it stays readable and secure.

Why do my WordPress category or tag pages show 404 errors?

WordPress category or tag pages may show 404 errors if your theme doesn’t support archive templates or if permalink settings are misconfigured. Resaving permalinks and checking your theme’s archive support can usually fix this issue.

How do I fix 404 errors for custom post types?

To fix 404 errors for custom post types, go to Settings » Permalinks and click ‘Save Changes’ to refresh rewrite rules. Also check that your custom post type is registered with the correct rewrite settings and has archive support if needed.

Can I redirect 404 pages to my homepage or another page?

Yes, you can redirect WordPress 404 pages using plugins like Redirection. This lets 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

Here are more resources we’ve put together to help you manage 404 errors and other common WordPress issues:

We hope this article helped you fix WordPress posts returning 404 errors. 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.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

773 CommentsLeave a Reply

  1. Hi,

    I have moved my two domains from a web hosting service provider to another web hosting service provider. The new web hosting service provider setup WordPress websites from the cPanel. Only the homepages are loading correctly but the other webpage links are showing Server Error 404 Page Not Found.

    The webhosting service provider told me to update my permalinks and the web.config code. I updated the permalinks to show “post name”. I don’t know how to update the web.config code. From watching these videos, I see that I should update the htaccess file. However, my htaccess do not show any missing text and it contains identical as shown in your video. What next should I do?

    Many thanks.

  2. My problem is, I moved my blog to a self host. And changed my permalink to “post name” Ever since then,

    1. I noticed my traffic start reducing,

    2. Couldn’t get searches from Google/yahoo/bing linking to my blog again.

    3. Got a lot of broken links.

    What do I do please?

    I’ve started getting discouraged with this..

  3. when i try to see plugins it gives 404 error.
    add plugin is working fine but i can’t get to plugin.php when i try to see
    installed plugins.
    also update-core.php also gives 404 error.
    what could be the reason?

  4. Hi,
    I have the same problem. I couldnt able to install a plugin which is this “themify-wc-product-filter.zip” .i always get file not found error 404 as result. can anyone help me out please? thanks guys in advance

  5. Hi,

    I have the same problem. The first solution worked for me, just now wordpress somehow keeps getting back tot the 404.
    So i click save changes, it works again. And then a few minutes later the 404 error is back. Anyone any ideas?

    Thanks.

    Kind regards,
    Sjoerd

  6. I have the same issue too….

    1) Changed Permalink
    2) Manullay created the .htaccess file
    3) removed and created the site once again

    Amy help is greatly appriciated

    Note: I am setting up a local instance in Ubuntu 16 LTS.

  7. I have a similar problem: I moved hosting providers and now my WP login box is top left hand corner of my browser screen and, most critically, when I login, every page and link for WP gives me a 404.

    The website loads fine for my visitors but I am unable to gain access myself in WP. Well, I am, I can log in, but that’s all I am able to do. After many years of web design, this is a first.

    I have done the following:
    1. deleted the .htaccess file
    2. tried an old .htaccess file
    3. created a new .htaccess file
    4. changed the name of some and all of the plugin folder names via ftp to see if there’s an issue with a plugin

    FYI, that I was unable to load my sample website (subdomain) after the migration, and all that was showing was a ‘database error’ white screen. I finally managed to track down the issue, and I was a little bit upset about it: in my new cPanel, I noticed the username had disappeared next to the database name, and when I tried re-entering it again it wouldn’t take it because I had been limited to only a few characters in length. I created a new username and updated the config file, and it works okay now.

    So, I opened my new cPanel and my previous cPanel side by side and my old host didn’t restrict me on database username character length, whereas my new host did to about 7 or 8.

    …so, I’m starting to think that even though all of my other subdomains and client websites are now all loading fine, that it may be that a different version of cPanel and how my new hosting provider has set it up has affected how I interact in WP for my failing website.

    v. 68.0.23 new cPanel
    v. 66.0.34 old cPanel

    Do you think there is an issue with how my new host has setup WHM and / or cPanel.

    Many thanks in advance : )

    • for me, after going nuts, i had to enable the rewrite module… i forgot to do this when I migrated sites.

      in ubuntu:
      sudo a2enmod rewrite

  8. I tried this .htaccess code but the error remains same as “Not Found
    The requested document was not found on this server.”

  9. I am wondering if this would fix my admin login page? Keeps showing 404 error and not the login page. I don’t have issues with a 404 error on pages and post. I think it might be conflicting plugin I’m using called Hide MyWp, but they told me its working and reset the settings anway and said it’s beyond their plugin control.

  10. Thank you! This worked for me. I did have to change the Common Settings from “Custom Structure” to “Post name”, but once I did that my blog came back.

  11. I followed your instructions, but I still get the “white page of death” with my posts. Is there a way to actually remove “index.php”?

    • Hi Nick,

      The index.php file is crucial for your WordPress site to work properly. If you think it is causing the issue, then you can download a fresh copy of WordPress, unzip on your computer, locate the index.php file and upload it to your website replacing the old file.

      Admin

  12. Hi every one..
    i have a website which is working properly but when i login to admin panel and want to edit a page it show me a error that “page not found” but in the front end it look fine this error show only on editing time ..
    please help me i am stuck
    Thanks in advance

  13. THANK YOU SO MUCH! I’ve tried everything else thinking it was a timing error. You saved me lots of time.

    Thank you again!

  14. didn’t work for me. installed Yoast SEO, noticed it defaulted to weird permalinks with /index.php/ in them, went to change that to normal way – no more permalinks for me… only works via ?p=123

  15. You guys are the best!

    I always find your tutorials to be just what I need to update/fix my WordPress site!

    Regarding the 404 not found issues, I had some template pages (I purchased a WordPress theme from a vendor and had some live pages hidden that I wasn’t using) that were getting indexed that I didn’t want indexed. So I changed the pages to “unpublished” in WordPress.

    I ran an analysis on indexability and now all those pages are showing “404 Not Found” errors.

    Do you all suggest a way to keep these pages from being indexed altogether? What is the best practice for fixing something like this?

    Thank you again for all the great work you all do!

  16. Hi
    please help to fix the following.
    while submitting a comment in my webpage its working properly but after 3 or more submission it showing 404 page not found
    how can i fix this problem without using a plugin.

  17. wow,
    this is very helpful.. my website is not not load page cause of URL not found
    i am go to permalinks & select other links & again i selected postname & save settings my website is work properly

  18. I had the problem with the permalinks and fixed the issue by saving as a plain permalink then saving as custom permalink. that worked but I am having a problem with the permalinks issue again. i fixed it by doing the above step again. is there a way to avoid it happening again. thanks!

  19. Hello guys,
    I have the same problem, some pages appear as ‘not found’ but they are present in wordpress. Check this one:
    I have updated permalinks but it didn’t work.
    I wouldn’t dare accessing my FTP and would like to know if there is any other way to change it? I use hosted wordpress.
    Thanks

  20. Hey,
    I am getting error for rest of my pages , excluding the home page. The images & the videos are not visible. I have done all the required steps. Kindly help me out.

  21. It helped. Very nice. Can you suggest best permalink structure? Also how to get social counts back after changing permalink structure?

  22. I am trying to add the wordpress blog as a subdirectory in nginx server. Added blog under cakephp/app/webroot/blog . Main page works fine but not the post links and sublinks. Shows not found error. I tried your post but no result. Can you please help me to sort out this?

    Thanks.

  23. Hello, I tried just about everything
    1. Deleted and uploaded new htaccess file
    2. Checked robots.txt
    3. Checked sitemap
    4. Disabled all plugins
    5. Checked google console
    6. Checked to see if my site is blacklisted
    Google will not communicate with my site all at.
    I only get “403 forbidden error”. I couldn’t even verify my site ownership with google until I verified through the “cname card”.
    During 1 test I did get a “200 server error”. Please help

  24. Hello! I downloaded the htaccess file and copy/pasted. I am still getting the 404 errors on my blog. Not sure what else to try. Any ideas?
    Thank you,
    Jill

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.