Black FridayCyber Monday 2026
14Days
15Hrs
22Mins
44Secs
Flat20% OFF

Our biggest sale of the year20% off the first payment on all maintenance plans. Code BF2026

Grab the deal
WordPress

WordPress Posts Showing 404 Errors: Fix Permalinks and Rewrite Rules

When posts return 404 but the home page loads, the rewrite rules are usually the problem. Re-save permalinks, check the server rule, then test plugins.

wpallsolution 6 min read

A WordPress posts 404 error is the problem where the home page loads but every post or page shows “Page not found”. WordPress uses “pretty permalinks”, such as /my-post/, which do not exist as real files, so the web server must hand every request to WordPress through a rewrite rule. When that rule is missing or the stored rewrite rules are out of date, WordPress never gets the request and you see a 404. This guide checks the usual causes in order, from the quickest fix to the server settings.

Quick answer

Go to Settings → Permalinks and click Save Changes without changing anything, which refreshes WordPress’s rewrite rules. If posts still 404, check the server rule: on Apache or LiteSpeed the WordPress block in .htaccess (with mod_rewrite available), on Nginx a try_files directive. Then test plugins and themes that register custom post types or change URLs. Back up before editing server files.

How this guide was prepared: it is research-based. We used the WordPress developer documentation for .htaccess and Nginx and the WordPress FAQ listed under Sources, checked on October 23, 2026. We did not test your server, and where your host controls the rules you may need their help.

A URL like /my-post/ is not a file. The server first looks for a real file or folder; if none exists, it must send the request to index.php so WordPress can find the post. The developer documentation shows the default Apache block: it turns on the rewrite engine and sends any request that is not an existing file or directory to /index.php. WordPress edits this block mainly to support pretty permalinks. Nginx has no .htaccess, so an administrator must add the rule at the server level with try_files $uri $uri/ /index.php?$args; inside the main location / block. Separately, WordPress keeps its own list of rewrite rules, which can go out of date after a plugin or theme change.

The decision tree: why do posts return 404?

Flowchart for WordPress posts returning 404 errors: five questions about which pages fail, permalink re-save, server type and recent changes
Five questions point to the rewrite rule that is missing.
  1. Only posts and pages fail, the home page works? Suspect the rewrite rules (Step 1).
  2. Re-saving permalinks changes nothing? Check the server rule (Step 2).
  3. Apache or LiteSpeed? Check the WordPress block in .htaccess; Nginx? Check try_files (Step 3).
  4. Started after a plugin or theme change? Test plugins and custom post types (Step 4).

Symptoms and likely causes

What you seeLikely causeStart with
Home page works, every post gives 404Missing server rewrite rule or stale WordPress rulesSteps 1 to 3
Only a custom post type or category 404sA plugin or theme registered it and the rules are not refreshedSteps 1 and 4
404 appeared after a move or a host changeThe new server lacks the rewrite ruleStep 3
The 404 page looks like your themeWordPress handled the request but found nothingSteps 1 and 4
A plain server error page with no themeThe request never reached WordPressStep 3

4 steps to fix WordPress posts showing 404 errors

Step 1: Check which pages fail, and where the 404 comes from

Open a post, a page, a category and the home page. If the 404 screen is styled like your theme, WordPress received the request and found nothing; if it is a plain server page, the request never reached WordPress. Note whether only one type (for example a custom post type) fails. Also check that the post is published and that its link has not changed.

Open Settings → Permalinks and click Save Changes, even if you change nothing. This flushes and rebuilds WordPress’s rewrite rules and also rewrites the .htaccess block where the server allows it. With WP-CLI, wp rewrite flush does the rewrite flush. This fixes many 404s after you activate a plugin or change a post type.

Step 3: Check the server rule

On Apache or LiteSpeed, open .htaccess in the WordPress folder and check that it contains the default block between # BEGIN WordPress and # END WordPress, with the rewrite rules that send missing files to index.php. If the file is missing or not writable, WordPress cannot write it; create it from a backup or ask your host. The rules also need mod_rewrite to be active, which the WordPress FAQ lists as a cause of pretty permalink 404s, and you may have to ask your host to enable it. On Nginx, check that the location / block contains the try_files directive and reload Nginx after a change. If you recently moved servers, read how to move WordPress to a new host.

Step 4: Test plugins, themes and redirects

Plugins that register custom post types, change permalinks, add redirects or add security rules can cause 404s. Deactivate them on a staging copy or one at a time, re-save permalinks and test; our guide to finding the plugin that broke your site shows a safe order, and WordPress plugin conflict explains conflicts. Check a redirect or SEO plugin for rules that point at the wrong place, and switch the theme to a default theme to rule out theme code. If the error appears as redirect loops instead, see ERR_TOO_MANY_REDIRECTS in WordPress.

Version and hosting differences

  • LiteSpeed reads .htaccess like Apache; Nginx needs server-level configuration.
  • Managed hosts often control the rewrite rules, so ask them if edits do not stick.
  • Sites in a sub-folder or on multisite use different rules; check your setup.

How to verify the fix

  • Posts, pages, categories and custom post types open normally.
  • Re-saving permalinks no longer changes the result.
  • Important old URLs still work, or redirect as intended.

How to prevent it from happening again

  • Re-save permalinks after you activate plugins that add post types.
  • Keep a copy of your .htaccess or server rules before a move.
  • Test a few URLs after every migration or host change.

Frequently asked questions

Why does the home page work but posts do not?

The home page is a real route; posts rely on the rewrite rule that sends the request to WordPress.

Yes, if you do not change the structure. It only refreshes the rules.

It can, because old URLs stop working unless redirects exist, so avoid changing it unless needed.

Can my host fix this?

Yes, especially if mod_rewrite or the Nginx rule needs to be enabled on the server.

What to do next

Re-save the permalinks, check the server rule and test plugins. If posts still return 404, wpallsolution offers an emergency WordPress fix and WordPress maintenance packages. We cannot promise a result without seeing your server setup.

Sources and official documentation

Keep reading

More guides

Need a hand with this?

Tell us what is happening. We reply with honest next steps.

Talk to us