WordPress 404 Error: Fix Missing Pages and Posts

To fix a WordPress 404 error, check the address, then resave Settings > Permalinks without changing your settings. If that doesn’t help, clear caches and work through redirects, plugin conflicts, and server rewrite rules.

Broken permalinks, damaged .htaccess rules, and a plugin conflict are common causes after updates or migrations. However, a deleted page needs a different fix. Start by identifying how much of your site is affected.

Key Takeaways

  • Resaving permalinks rebuilds routing rules without changing your URLs.
  • Restore missing content or redirect its old address to a relevant replacement.
  • Back up configuration files before editing them, and test the original failing URL after each change.

Identify Which URLs Return a WordPress 404 Error

A 404 Not Found response means the requested address didn’t resolve to available content. It doesn’t necessarily mean WordPress deleted your post.

Compare these symptoms before changing anything.

What failsWhere to start
One post or pageURL spelling, slug, publication status, or Trash
Homepage works, but posts failPermalinks and server rewrite rules
Images or PDFs failMissing files or incorrect upload paths
Dashboard and public pages failSite URLs, security rules, or server routing

The distinction matters: rebuilding permalinks won’t restore a deleted image file.

To investigate a broken URL and find other affected addresses, open Google Search Console and select Pages > Why pages aren’t indexed > Not found (404). Export the list as CSV or to Google Sheets.

For ongoing logging, the free Redirection plugin records requests under Tools > Redirection > 404s. Prioritize URLs your visitors actually need; random bot requests don’t all need redirects.

Check the URL and Restore Missing Content

Match the address to the published slug

Open the affected item under Posts > All Posts or Pages > All Pages. Compare its permalink with the failing address, including spelling, parent-page paths, and any date segments.

Then use View Post or View Page. If that address works, repair the outdated link rather than changing server configuration.

Also check publication status. Draft, private, and scheduled content isn’t publicly available in the same way as a published page.

Recover a deleted post or page

An open metal file drawer filled with neatly arranged manila folders in a warm records room.

Open Trash, locate the missing item, and click Restore. Then review its status and publish it if necessary.

If you permanently deleted it, recover the content from a backup. Prefer a targeted restore or staging recovery because rolling back the whole database can overwrite newer posts and orders. Restore the original slug when possible.

Refresh Permalinks and Clear Cached Errors

Rebuild WordPress rewrite rules

If published content exists but its address fails, refresh its routing:

  1. Record your current structure under Settings > Permalinks.
  2. Click Save Changes without changing anything, then retest.
  3. If it still fails, select Plain and save. Then reselect Post name and save again if that was your original structure. Otherwise, restore your recorded structure.

Don’t leave an established site on a different structure without redirects. Our guide to WordPress permalink settings covers safe changes.

The official permalink settings documentation also explains how to update permalink settings manually.

Purge every relevant cache

After refreshing permalinks, clear your browser cache, WordPress caching plugin, hosting cache, and CDN cache. Then retry in a private browser window.

A cache can keep returning an old 404 after you’ve fixed its cause. If only one browser or network fails, compare another connection before editing site files.

Review Redirects for Moved Pages

When content has moved permanently, create a 301 redirect to its closest replacement. In Redirection, enter the old path without the domain as the source and the destination address as the target.

Choose a page that answers the same need. A homepage redirect should be a last resort, and an unrelated homepage often isn’t a useful replacement. If you intentionally removed content with no equivalent, keeping a genuine 404 is reasonable.

Also review existing rules in your redirect plugin, hosting panel, and CDN. Don’t run two redirect plugins at the same time.

Redirecting two addresses to each other creates a loop. You’ll see ERR_TOO_MANY_REDIRECTS instead of the original 404.

After adding a redirect, follow the old link while logged out and confirm it reaches the intended page.

Test for Plugin and Theme Conflicts

Isolate the plugin responsible

Take a files-and-database backup first. Prefer staging because disabling plugins can interrupt checkout, forms, or memberships.

If you can access the dashboard, deactivate plugins and retest. Otherwise, connect through SFTP or FTP, or use your hosting file manager. Rename wp-content/plugins to disabled_plugins.

Visit the dashboard’s Plugins screen so WordPress records the missing plugins as inactive. Then restore the folder name to plugins.

Reactivate plugins one at a time and repeat the failing request. If the error returns after you activate one plugin, that plugin is the likely source of the plugin conflict. Disable it again to confirm.

Our guide to troubleshooting WordPress plugin conflicts covers safer isolation methods.

Rule out your theme

Temporarily activate a default theme such as Twenty Twenty-Five under Appearance > Themes, then test a normal post. If the post works with Twenty Twenty-Five, your previous theme may be causing the 404.

Plugins and themes can register custom WordPress rewrite rules. Therefore, a missing custom post type may depend on the component you just disabled. Re-enable that component and resave permalinks before concluding its content is gone.

Repair Apache’s .htaccess Rules Safely

A close view of a server room with orderly network equipment and a single glowing amber status light.

On Apache, .htaccess routes readable URLs to WordPress. Nginx doesn’t read this file.

Enable Show hidden files in your FTP client or file manager. Find .htaccess in your site’s root, usually beside wp-config.php, and download a backup before editing.

For a standard single-site installation at the domain root, the WordPress block is:

# BEGIN WordPress
<IfModule mod_rewrite.c>
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]
</IfModule>
# END WordPress

Replace only the WordPress-managed block. Keep custom redirects and security directives outside its markers because WordPress can overwrite everything inside them. Multisite and subdirectory installations need their own generated rules.

These conditions pass requests to WordPress only when no real file or directory matches. The WordPress permalink documentation explains the routing requirements.

If saving permalinks displays rules for manual installation, WordPress couldn’t write them automatically. Don’t make .htaccess world-writable.

When valid rules still fail, give hosting support the failing URL and ask them to check server logs. Have them confirm enabled mod_rewrite, permitted .htaccess overrides, correct ownership, and file permissions. Restore your backup immediately if editing causes a 500 error.

Check Migration URLs and Nginx Routing

Correct mismatched site addresses

After a migration, review Settings > General and confirm the public site URL. WordPress Address identifies the core installation; Site Address identifies the public site. Preserve an intentional installation subdirectory.

If incorrect settings prevent login, back up wp-config.php. Replace the example addresses below with your actual addresses, then add these definitions above the “That’s all, stop editing” comment:

define('WP_HOME', 'https://example.com');
define('WP_SITEURL', 'https://example.com');

Edit existing definitions rather than adding duplicates. These constants override the saved addresses; they don’t replace old links inside your content.

Also confirm the migration included uploaded files. Server routing can’t recover missing media.

Repair Nginx’s request handling

If your homepage works but every readable post URL fails on Nginx, the server may lack its WordPress fallback:

location / {
    try_files $uri $uri/ /index.php?$args;
}

This is a root-installation example, not a universal replacement for an existing server block. The official Nginx administration guide explains why WordPress can’t update this configuration itself.

On managed hosting, have support repair the fallback. If you administer the server, validate the configuration with nginx -t before reloading Nginx. Subdirectory installations need matching paths.

Prevent Broken Links After the Fix

Keep published slugs stable. Before changing a domain or permalink structure, save your existing URL list and map old addresses to matching new ones to prevent broken links.

After moving content, update internal links, navigation menus, and sitemap entries, then check for broken links. Direct links avoid unnecessary redirect hops.

Review Search Console and Redirection logs periodically. Repeated requests to a deleted address can reveal an overlooked menu item or an external link worth preserving. Our WordPress SEO guidance covers related sitemap and technical checks.

Frequently Asked Questions

Why does my WordPress admin return 404?

An incorrect site address, a security plugin’s hidden-login feature, or server routing can block the dashboard. Test /wp-admin/ and /wp-login.php directly, then follow the plugin-isolation and migration checks above. On WordPress.com or another managed service without file access, contact the provider’s support team.

Where can I find logs for a 404 error?

Check your hosting server logs, starting with access logs filtered for status 404; these record requests even when PHP reports no error. WordPress’s /wp-content/debug.log exists only when debug logging is enabled and something gets logged. A normal missing page may never appear there. Apache or Nginx error logs can reveal server configuration problems.

Get the Original URL Working Again

The fastest fix starts with the right diagnosis. A missing post needs restoration or a relevant redirect, while widespread failures usually call for routing checks.

Make one reversible change at a time, then retest the exact broken address. Once it works, update old links so visitors reach the page directly.

Picture of Andy Feliciotti

Andy Feliciotti

Andy has been a full time WordPress developer for over 15 years. Through his years of experience has built 100s of sites and learned plenty of tricks along the way. Found this article helpful? Buy Me A Coffee

Leave a Reply

Your email address will not be published. Required fields are marked *

WordPress Tips Monthly
Get the latest from SmartWP to your inbox.