WordPress 404 Error on Posts and Pages: Fix

WordPress posts showing 404 but the homepage works? Run our free plain link test, then reset permalinks, check .htaccess or fix one missing post safely.

Share this post
7 min read

Last updated December 2, 2026

Your homepage loads, but every post or page shows “404 Not Found”. Your content is still in the dashboard, so where did it go?

Usually nowhere. WordPress just lost the rules that turn pretty links into posts. One quick test proves it.

This guide shows that test, then the fix for each pattern of 404 errors.

Key Takeaways

  • Homepage works but posts 404? The permalink rules are usually broken, not your content.
  • Test with the plain link, example.com/?p=123. WordPress says it works on all servers.
  • Fix most cases by saving Settings, Permalinks without changing anything.
  • On Apache hosts, check that .htaccess has the WordPress block.
  • Only one post 404s? Check its status and slug instead.
Your posts are safe. Saving permalinks only rebuilds link rules. It does not edit or delete any content.

Run the Plain Link Test

WordPress’s permalink documentation says the Plain permalink, example.com/?p=N, works on all server environments. That makes it a perfect test.

Plain link test builder

Find the post number in Posts, All Posts. Hover the title and look for post= in the edit link. Enter it below.

Your test link appears here.

Digieh tool. Runs in your browser only. Nothing is sent to us.

Editor’s Note

This guide is accurate as of Digieh check. If the plain link loads and the pretty link shows 404, the rewrite layer is at fault, not your content. Most guides skip this test and go straight to fixes.

Spot an error in this article? Please contact us at support@digieh.com or read our Corrections Policy.

Find Your Fix

Now tell the finder which pages fail and what the test showed.

WordPress 404 fix finder

Answer two questions. The finder points to the layer that needs fixing. It runs in your browser only.

Digieh tool. Based on WordPress.org documentation, read December 2, 2026.

Which 404 Pattern Do You Have?

PatternLikely causeFix first
Homepage works, all posts 404Permalink rules lostSave permalinks
Only one post 404sDraft, trash or changed slugCheck status, add redirect
Whole site 404sDomain, hosting or serverContact your host
New posts 404 after a pluginPlugin rules clashDeactivate, save permalinks

Based on WordPress.org permalink documentation and WordPress developer docs on .htaccess. Patterns are Digieh’s reading.

1 clickSaving Settings, Permalinks rebuilds the link rules. Flushing rules is expensive, so do it only when needed. Source: WordPress developer reference.

How Do You Reset Permalinks?

This fixes most cases where the homepage works but posts do not.

  1. Log in to your WordPress dashboard.
  2. Go to Settings, Permalinks.
  3. Do not change anything. Just click Save Changes.
  4. Open a post in a private window to test.

Saving makes WordPress rebuild its rules. On Apache hosts, it also tries to update the .htaccess file.

Test in a private window. Caching plugins and browsers can keep showing the old 404 page. A private window shows the real result.

Free updates

Join the Digieh list

Be the first to know when our weekly brief launches.

No spam. Unsubscribe anytime. Read our Privacy Policy.

How Do You Check the .htaccess File?

On Apache hosts, pretty links depend on a few lines in .htaccess. WordPress developer docs give the basic block:

# 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

Open the file in your host’s file manager, in the main WordPress folder. Make a copy before you edit it.

If the file is missing, create a new one named .htaccess with the block above. Then save Settings, Permalinks again so WordPress can check it.

Our WordPress 500 error guide explains how to repair a damaged .htaccess safely.

What caused your WordPress 404 errors?

  • Permalink rules needed a save
  • .htaccess problem
  • A plugin
  • One post was moved or deleted
  • Not sure

Why Does Only One Post Show 404?

If the rest of the site works, the problem is that one post. Check these first:

  • The post is in Draft, Pending or Scheduled status.
  • The post was moved to Trash.
  • Someone changed the slug, so the old link no longer exists.
  • The post is private and you are logged out.

If the slug changed, add a redirect from the old link to the new one. Our page with redirect guide explains how Google sees redirects.

What If Your Host Uses Nginx?

Nginx servers do not read .htaccess files. Saving permalinks will not write server rules there.

WordPress docs say your host should set up the server for pretty permalinks. If posts 404 on Nginx, contact your host and ask them to check the WordPress rewrite rules.

Not sure which server you have? Your host’s control panel or support chat can tell you in seconds.

Some hosts run both, with Nginx in front of Apache. In that case .htaccess still matters, so check it too.

Managed WordPress hosts often handle rewrite rules for you. If saving permalinks does nothing, open a ticket with them.

Can a Plugin Cause 404 Errors?

Yes. Plugins that add custom post types, shops or translations add their own link rules. A clash can break posts.

  1. Deactivate the plugin you added or updated last.
  2. Save Settings, Permalinks again.
  3. Test a post in a private window.
  4. If it works, reactivate the plugin and save permalinks once more.

If the 404 returns after reactivating, contact the plugin’s support team with the steps you tried.

What Is a Permalink in WordPress?

A permalink is the permanent web address of a post, like yoursite.com/my-first-post. WordPress builds it from the structure you pick in Settings, Permalinks.

Behind the scenes, every post has a number. The pretty link is a friendly label that rewrite rules turn back into that number.

WordPress docs advise ending a custom structure with %postname% or %post_id%. That way, each link points to exactly one post.

Can Caching Cause 404 Errors?

Yes. A caching plugin or your host’s cache can save a 404 page. It may keep showing it after you fix the cause.

  1. Clear the cache in your caching plugin.
  2. Clear any host or server cache from your hosting panel.
  3. If you use a content delivery network, purge its cache too.
  4. Test again in a private browser window.

If the post loads after clearing caches, the fix already worked. The cache was just hiding it.

How Do You Find Every 404 on Your Site?

Google Search Console lists pages that return 404. Open Indexing, Pages and look for Not found (404).

  • Check whether each link should exist.
  • Fix or restore pages that were removed by mistake.
  • Redirect old links that moved to a new address.
  • Leave real dead pages as 404. That is the correct signal.

After fixing, use Validate fix in Search Console. Google then rechecks the affected pages.

How Do 404 Errors Affect Google?

Real 404s on pages that should exist can drop out of Google over time. Fix them quickly, then request indexing in Search Console.

Pages that show content but tell Google they are missing are a different issue. See our soft 404 errors guide.

Try this today. Bookmark one plain link like yoursite.com/?p=1. It gives you a ten second health check for your permalinks.

Seeing “redirected you too many times” instead of a 404? Use our WordPress too many redirects guide.

Test Yourself

The plain link ?p=125 loads, but the pretty link shows 404. What is broken?

  1. The permalink rewrite rules
  2. The post content
  3. Your domain

WordPress says plain links work on all servers, so a working plain link proves the content exists.

Does saving Settings, Permalinks delete posts?

  1. No, it only rebuilds link rules
  2. Yes, it removes old posts
  3. Yes, it resets the theme

Saving permalinks rebuilds the rules that map links to posts. Content is untouched.

Frequently Asked Questions

Why do my WordPress posts 404 but the homepage works?

The permalink rules are usually lost. Save Settings, Permalinks to rebuild them.

Will changing permalinks hurt my search rankings?

Changing the structure breaks old links. Saving without changes is safe.

Where is the .htaccess file?

In the main WordPress folder on Apache hosts. It may be hidden in the file manager.

Why does a new post show 404?

A plugin or cache may be the cause. Save permalinks and clear the cache.

Should I switch to Plain permalinks?

Only as a short test. Plain links are not friendly for readers or search.

Conclusion

Run the plain link test first. If it loads, save Settings, Permalinks and check .htaccess on Apache hosts. If one post fails, check its status and slug. If the whole site fails, or the host uses Nginx, contact your host.

Editor’s Note

This guide is accurate as of December 2, 2026. We checked WordPress.org documentation and WordPress developer resources on permalinks and .htaccess on that date.

Spot an error in this article? Please contact us at support@digieh.com or read our Corrections Policy.

Keep exploring

Your next read is waiting

Found this useful?

Share this post
Avatar photo

Syed Wasif Raza

Syed Wasif Raza is the founder and editor of Digieh. He writes about health, food, lifestyle, news and sports in plain, easy English. Every guide he publishes is checked against official sources such as government and health agency pages. Connect with him on LinkedIn.

Articles: 929

Leave a Reply

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