QUICK ANSWER

WordPress 404 errors on pages and posts that exist are almost always caused by a corrupted or missing .htaccess file, or permalink settings that need refreshing. The fastest fix: go to Settings > Permalinks in your WordPress admin and click Save Changes — this regenerates the .htaccess file and resolves the 404 in about 30 seconds.

Fastest fix: Settings > Permalinks > Save Changes. Done in 30 seconds. If that doesn’t work, continue with the fixes below.

Your WordPress posts and pages definitely exist — you can see them in the dashboard — but clicking on them shows a 404 “Page Not Found” error. This is one of the most common WordPress problems and one of the easiest to fix.

The 404 error in this case is not about missing content. It is about WordPress being unable to route the URL correctly to find that content. This guide covers every possible cause and fix, ordered from the simplest to the most advanced.

NOTE  This guide covers 404 errors on existing posts/pages. If you deleted content and want to redirect the old URL, that is a different scenario covered at the bottom of this post.

Table of Contents

  • Why does WordPress show 404 on pages that exist?
  • Fix 1: Refresh permalinks (fixes 80% of cases)
  • Fix 2: Restore or fix the .htaccess file
  • Fix 3: Fix 404s on Nginx servers
  • Fix 4: Deactivate conflicting plugins
  • Fix 5: Fix 404 after site migration
  • Fix 6: Fix 404 on WordPress Multisite
  • Fix 7: Fix 404 on custom post types
  • How to redirect deleted pages (301 redirects)
  • Frequently asked questions

Why Does WordPress Show 404 on Pages That Exist?

WordPress uses a rewrite system to turn clean URLs like yourdomain.com/my-post/ into database queries that fetch the right content. This rewrite system relies on rules stored in your .htaccess file (on Apache servers) or in your server’s Nginx config.

When these rewrite rules are missing, corrupted, or not loaded by the server, WordPress cannot match the URL to any content — so it returns a 404, even though the post or page is perfectly intact in the database.

Root CauseHow CommonFix to Use
Permalinks need refreshingVery common (50%)Fix 1
Corrupted .htaccess fileCommon (20%)Fix 2
Nginx missing rewrite rulesLess commonFix 3
Plugin conflictLess commonFix 4
Site migration / URL mismatchCommon after migrationsFix 5
Multisite configurationMultisite specificFix 6
Custom post type not registeredDeveloper specificFix 7

FIX 1: Refresh Permalinks — Fixes 80% of Cases    Difficulty: Beginner  |  Time: 30 seconds

This is the first thing you should always try. Saving the permalink settings forces WordPress to regenerate the rewrite rules in your .htaccess file. No content is changed or deleted — it is purely a settings refresh.

Steps

  1. Log in to your WordPress admin dashboard
  2. Go to Settings in the left sidebar
  3. Click Permalinks
  4. Do not change any settings — simply scroll to the bottom and click Save Changes
  5. Visit one of the pages or posts that was showing a 404 error
  6. The page should now load correctly

NOTE  This fix works because it rewrites the rewrite rules in your .htaccess file. It is completely safe and takes 30 seconds. Always try this before anything else.

If Save Changes does not immediately work

Try switching to a different permalink structure first, click Save Changes, then switch back to your original structure and click Save Changes again. This forces a full rewrite rule flush:

  1. Go to Settings > Permalinks
  2. Change the permalink structure to Plain (the first option)
  3. Click Save Changes
  4. Change back to your original structure (e.g. Post name)
  5. Click Save Changes again
  6. Test your pages

FIX 2: Restore or Fix the .htaccess File    Difficulty: Beginner  |  Time: 3 minutes

If refreshing permalinks did not fix the 404 error, your .htaccess file may be corrupted, missing, or have rules that conflict with WordPress’s rewrite system. Replacing it with a clean default version almost always resolves the problem.

Step 1: Check if .htaccess exists

  1. Connect to your site via FTP (FileZilla) or cPanel File Manager
  2. Navigate to your WordPress root folder (usually public_html)
  3. Enable ‘Show Hidden Files’ — .htaccess is a hidden file starting with a dot
  4. Look for a file named .htaccess

Step 2: Replace with default WordPress .htaccess

Whether the file is missing or corrupted, create a fresh one with this exact content:

# BEGIN WordPress

RewriteEngine On

RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

RewriteBase /

RewriteRule ^index\.php$ – [L]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . /index.php [L]

# END WordPress

  1. Save this as .htaccess in your root folder
  2. Go back to Settings > Permalinks and click Save Changes
  3. Test your pages

IMPORTANT  If WordPress is installed in a subfolder (e.g. yourdomain.com/wordpress/), the RewriteBase must include that subfolder path: RewriteBase /wordpress/ — otherwise all pages will still return 404.

Check that mod_rewrite is enabled

The WordPress rewrite system requires Apache’s mod_rewrite module. If this module is disabled on your server, no .htaccess rewrite rules will work. Contact your hosting provider and ask them to confirm that mod_rewrite is enabled for your account. All major shared hosts enable it by default.

FIX 3: Fix 404 Errors on Nginx Servers    Difficulty: Intermediate  |  Time: 5 minutes

Nginx servers do not use .htaccess files. If your hosting uses Nginx (common on VPS servers, Digital Ocean, Cloudways, and some managed hosts), the WordPress rewrite rules must be added directly to the Nginx server configuration file. Without these rules, every page except the home page returns a 404.

The required Nginx rewrite block for WordPress

Ask your server administrator or hosting support to add this block to the Nginx server block configuration for your site:

location / {

    try_files $uri $uri/ /index.php?$args;

}

This single block tells Nginx to pass any URL it cannot find as a static file to WordPress’s index.php, which then routes it correctly.

On Cloudways

  1. Log in to your Cloudways account
  2. Go to Servers > your server > Settings & Packages > Advanced
  3. Look for the Nginx configuration section
  4. The try_files directive should already be present — if it is missing, contact Cloudways support

On Digital Ocean or custom VPS

  1. SSH into your server
  2. Edit your site’s Nginx config file — usually found at /etc/nginx/sites-available/yourdomain.com
  3. Add the try_files block inside the server block
  4. Test the config: sudo nginx -t
  5. Reload Nginx: sudo systemctl reload nginx

WARNING  Nginx config changes require root or sudo access. If you are not comfortable with server administration, contact your hosting provider’s support — most VPS hosts will make this change for you.

FIX 4: Deactivate Conflicting Plugins    Difficulty: Beginner  |  Time: 3 minutes

Some plugins register their own URL rewrite rules that can conflict with WordPress’s built-in routing. SEO plugins, custom post type plugins, membership plugins, and e-commerce plugins are the most common culprits. When their rewrite rules clash with WordPress core rules, 404 errors appear on posts and pages.

Steps

  1. Go to Plugins > Installed Plugins in your WordPress admin
  2. Select all plugins and use Bulk Actions > Deactivate
  3. Test whether the 404 error is gone
  4. If it is gone, reactivate plugins one by one, testing after each
  5. After each activation, go to Settings > Permalinks and click Save Changes — many plugin conflicts are resolved simply by flushing rewrite rules after activation
  6. If a specific plugin always triggers the 404, check for a settings conflict or contact the plugin developer

Common plugin types that cause 404 conflicts

  • SEO plugins — Yoast SEO, Rank Math (usually fixed by flushing permalinks)
  • WooCommerce — shop page or product page 404s after installation
  • Membership plugins — MemberPress, Restrict Content Pro
  • Custom post type plugins — if rewrite rules are not registered correctly
  • Security plugins — some block URL patterns that match your post slugs

PRO TIP  After activating or deactivating any plugin that registers custom post types or taxonomies, always go to Settings > Permalinks and click Save Changes to flush the rewrite rules. This prevents 90% of plugin-related 404s.

FIX 5: Fix 404 Errors After Site Migration    Difficulty: Intermediate  |  Time: 10 minutes

404 errors are extremely common after moving a WordPress site to a new domain, a new host, or a new server. There are usually two separate issues to fix after a migration: the WordPress URL settings and the .htaccess file.

Step 1: Update WordPress Address and Site Address

  • Go to Settings > General in your WordPress admin
  • Check that WordPress Address (URL) and Site Address (URL) both show your new domain
  • If they still show the old domain, update them and click Save Changes
  • Then go to Settings > Permalinks and click Save Changes

Step 2: Update URLs in the database

If posts and pages are still returning 404 after step 1, old URLs may be hardcoded in the database. Use the free Search Replace DB tool or the Better Search Replace plugin to update all instances of the old domain to the new one:

  • Install and activate Better Search Replace from the WordPress plugin directory
  • Go to Tools > Better Search Replace
  • In Search for, enter your old domain: http://olddomain.com
  • In Replace with, enter your new domain: https://newdomain.com
  • Select all database tables
  • Run as dry run first to preview changes, then run the live replace
  • Go to Settings > Permalinks and click Save Changes

Step 3: Check file permissions after migration

Some migrations change file permissions. Ensure your .htaccess file is set to 644 — if it is set to 000 or 400, the server cannot read it and all pages return 404.

TIP  After a migration, always run through this checklist in order: (1) update WordPress/Site URL, (2) replace old URLs in database, (3) flush permalinks, (4) check .htaccess permissions. Doing them out of order often means repeating steps.

FIX 6: Fix 404 Errors on WordPress Multisite    Difficulty: Intermediate  |  Time: 5 minutes

WordPress Multisite requires different .htaccess rules than a standard WordPress installation. If you recently enabled Multisite or migrated a Multisite network, the standard WordPress .htaccess rules will cause 404 errors on all sub-sites.

For subdirectory Multisite (yourdomain.com/site2/)

Your .htaccess should contain these rules instead of the standard ones:

RewriteEngine On

RewriteBase /

RewriteRule ^index\.php$ – [L]

# add a trailing slash to /wp-admin

RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]

RewriteCond %{REQUEST_FILENAME} -d

RewriteRule ^ – [L]

RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]

RewriteRule ^([_0-9a-zA-Z-]+/)?(.*.php)$ $2 [L]

RewriteRule . index.php [L]

For subdomain Multisite (site2.yourdomain.com)

Subdomain Multisite uses standard WordPress .htaccess rules, but requires wildcard DNS to be configured at your domain registrar so that *.yourdomain.com resolves to your server. Contact your hosting provider to enable wildcard DNS if subsite domains are returning 404.

NOTE  After updating Multisite .htaccess rules, go to Network Admin > Dashboard and click Update Network to flush rewrite rules across all sites in the network.

FIX 7: Fix 404 on Custom Post Types    Difficulty: Intermediate  |  Time: 5 minutes

If only a specific custom post type (CPT) returns 404 while regular posts and pages work fine, the rewrite rules for that CPT are not being registered correctly. This is common after updating a plugin that registers a CPT, or after manually registering a CPT in functions.php.

Quick fix: flush rewrite rules

  • Go to Settings > Permalinks and click Save Changes
  • This flushes all rewrite rules including CPT rules
  • Test the CPT pages

If the CPT is registered in a plugin or theme

Check that the plugin or theme registering the CPT has ‘rewrite’ set to true in the register_post_type() call:

register_post_type( ‘your_post_type’, array(

    ‘rewrite’ => array( ‘slug’ => ‘your-slug’ ),

    // other arguments

) );

If the CPT slug conflicts with a page slug

If you have a page with the same slug as your CPT base slug (for example, a page called ‘portfolio’ and a CPT with the slug ‘portfolio’), WordPress cannot route them correctly and one will always return 404. Rename either the page slug or the CPT slug to remove the conflict, then flush permalinks.

How to Redirect Deleted Pages (301 Redirects)

If you intentionally deleted a post or page and want to redirect its old URL to a new location — to preserve SEO value and avoid broken links — you need a 301 redirect. This is different from fixing a 404 on an existing page.

Using Rank Math (free)

  • Go to Rank Math > Redirections in your WordPress admin
  • Click Add New
  • In Source URL, enter the old URL path (e.g. /old-page/)
  • In Destination URL, enter the new URL
  • Set Type to 301 Permanent
  • Click Save

Using .htaccess (Apache servers only)

Add this line to your .htaccess file, above the WordPress rules:

Redirect 301 /old-page/ https://yourdomain.com/new-page/

SEO TIP  Always use 301 (permanent) redirects for deleted content, not 302 (temporary). Google transfers the SEO value (PageRank) of the old URL to the new URL only with a 301 redirect.

Frequently Asked Questions

Why does WordPress show 404 on all pages except the home page?

This is the classic symptom of missing or broken rewrite rules. The home page works because it is served directly by index.php without needing any URL rewriting. All other pages rely on the rewrite rules to route their URLs correctly. Fix 1 (refreshing permalinks) and Fix 2 (restoring .htaccess) resolve this in virtually every case. On Nginx servers, Fix 3 applies instead.

WordPress 404 started after a WordPress core update — what should I do?

Core updates occasionally overwrite or reset .htaccess rules. Go to Settings > Permalinks and click Save Changes immediately after a core update — this regenerates the .htaccess file with the correct rules. This takes 30 seconds and should be part of your post-update routine.

My posts return 404 but pages work fine — what does that mean?

This points to a permalink conflict between your post permalink structure and something else registering the same URL pattern — often a plugin or a page with a conflicting slug. Check if any of your pages have a slug that matches your post category or tag base. Also check Fix 4 (plugin deactivation) to identify if a specific plugin is causing the routing conflict.

Does a 404 error hurt my SEO?

A 404 on a page that never existed or was intentionally removed does not hurt SEO. A 404 on a page that used to rank and have backlinks pointing to it will cause you to lose that ranking and link equity over time. If valuable pages are returning 404, fix the error or set up 301 redirects to preserve SEO value. Use Google Search Console > Coverage to see which URLs Google is reporting as 404.

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

Three free methods: (1) Google Search Console — go to Coverage > Not Found (404) to see every URL Google has crawled that returned a 404. (2) Install the Broken Link Checker plugin — it scans your entire site and reports all broken internal and external links. (3) Check your hosting server error logs in cPanel under Metrics > Errors — 404 responses are logged there with the exact URLs.

Can I customize the WordPress 404 page?

Yes. WordPress uses a template file called 404.php inside your active theme to display the 404 page. You can edit this file to add a search box, popular posts, or a custom message. Many themes also let you customize the 404 page through the theme customizer without editing any code. This does not fix the 404 error — it only improves the experience for visitors who encounter one.

Wrapping Up

WordPress 404 errors on existing posts and pages are almost always a rewrite rules problem — not a content problem. Start with Fix 1 (Settings > Permalinks > Save Changes) — it resolves 80% of cases in 30 seconds. If that does not work, replace your .htaccess file with the default WordPress version (Fix 2).

For migrations, always update your WordPress URLs and flush permalinks as the very first step before anything else. For Nginx servers, the try_files directive is all you need. Work through the fixes in order and your pages will be back online quickly.

Leave a comment