You probably know the feeling: you publish a new page or blog post on your WordPress site, but instead of your content you get a “404 Not Found” error. Very frustrating, especially if you just invested time in the content. In this knowledge base article I explain in clear language what this 404 error means, why it can happen (often after creating a new page, changing permalinks, or because of caching/plugins), and above all how you can solve it step by step. At the end you’ll find a short checklist and a gentle tip for extra help. Let’s begin!
What is a “404 Not Found” error?
A 404 error simply means the requested page cannot be found on the server. In other words: your browser requests a URL, but WordPress can’t find the right page based on that URL. In the WordPress context I often see that the page does exist in the dashboard, but something went wrong with the link to it. There’s a kink between the permalink (the URL of your post/page) and the actual content. The result is that WordPress returns a “404 – Page Not Found” because it cannot load the page.
Why is it important to fix this quickly? Besides visitors not being able to see your content, it can also hurt your visibility if multiple pages return 404 errors. Search engines can then crawl your site less effectively. Luckily a 404 in WordPress is usually temporary and relatively easy to fix. Below I discuss the causes and solutions.
Why do you get a 404 error in WordPress?
There are a number of common situations that can cause a WordPress page or post to suddenly return a 404 error:
- Permalinks (URL settings) are “broken”: WordPress uses permalinks and so‑called rewrite rules to translate pretty URLs (like
/my-post) into the correct page. If that translation fails, WordPress can’t find the page. This often happens right after changing the permalink structure or moving your site. The server doesn’t know how to handle the new URLs if the settings were not applied correctly. A corrupt or missing.htaccessfile (on Apache servers) is often the culprit. - New page right after publishing: you created a new post or page and immediately get a 404 when you visit it. This often also comes down to permalinks: WordPress normally generates the correct rewrite rules, but sometimes those rules haven’t been refreshed yet. For example if you previously changed your permalink structure or caching is involved, the new URL may not be recognized and result in a 404.
- Plugin or theme conflicts: certain plugins (or themes) can interfere with how WordPress handles URLs. For example a plugin that introduces custom post types or its own URL routes, or a security plugin that changes the URL structure. This can lead to “broken permalinks” and 404s on pages that previously worked fine. Custom code snippets in your theme functions can also disrupt permalink behavior in rare cases.
- Caching (plugin or server-side): caching is great for performance, but it can cause issues with new or changed pages. Suppose a page didn’t exist earlier and returned a 404—a caching plugin or server (e.g., Varnish/NGINX) may have cached that 404 page. After publishing the page, you may still see the old 404 from cache instead of the real page. I’ve seen services like Cloudflare or hosting caches keep showing a 404 until the cache was cleared. Some caching plugins also add custom rules to
.htaccessthat have unwanted side effects. - Incorrect URL or the page really doesn’t exist: of course it can also be something basic, like a typo in the URL or a link pointing to a page that no longer exists. If a page is still a draft or private, visitors will also see a 404. It sounds obvious, but it’s always worth checking that you have the correct URL and that the post is actually published.
Now that the possible causes are clear, you can investigate the problem more directly.
Checklist: first checks for a 404 error
Before diving into technical fixes, here’s a short checklist. Go through these points as soon as you encounter a 404 message on your WordPress site:
- URL spelled correctly? Check that the link contains no typos. URLs are case-sensitive after the domain name;
/Pageis different from/page. Usually this won’t be the cause, but it’s good to rule it out. - Page/post published? Log in to WordPress and check that the content isn’t accidentally set to Draft or has a future publish date. An unpublished (or private) page returns a 404 for logged-out visitors. Publish the page or adjust the visibility if needed.
- Permalink settings: go to Settings > Permalinks in your WordPress dashboard. Is the desired permalink structure correctly set (for example “Post name”)? Note the current setting; you’ll re-confirm the permalinks anyway.
- Does the
.htaccessfile exist (for Apache servers)? This hidden file in the root of your WordPress site controls URL rewrites. If you’re on Apache-based hosting (most shared hosting), there should be a.htaccessfile with WordPress’ default rules. If the file is missing or the rules aren’t there, your pretty URLs won’t work and you’ll get 404s. (How to check this is covered in the steps below.) - Eliminate caching: do you use a caching plugin (like WP Rocket, W3 Total Cache, LiteSpeed Cache, etc.)? Clear its cache. This also applies to any server-level caching by your host, and CDNs like Cloudflare. That way you know you’re not being served an old 404 page from cache. Also try your browser cache/incognito, though it’s less likely.
- Plugins or theme: did you install or update something shortly before the 404 appeared? Think of a plugin for SEO, security, translations, or custom post types. Temporarily deactivate suspicious plugins to see if the 404 disappears. In very rare cases the theme can conflict; switching to a default theme can rule that out, but it’s usually not necessary unless all pages return 404.
Checked the items above? Then it’s time to walk through the solutions step by step. In many cases you can fix the problem within minutes.
Step-by-step: fixing a 404 error in WordPress
Follow the solutions below in order. After each step, test whether the page loads. If not, move on to the next step.
Step 1: Re-save (flush) permalinks
The simplest and most common solution for WordPress 404 errors is flushing your permalinks. This means forcing WordPress to rebuild the rewrite rules (URL routing). You don’t need to do anything technical—this can be done in the dashboard:
- Go to Settings > Permalinks in your WordPress admin.
- Click Save Changes without changing any settings. WordPress refreshes the permalink rules in the background.
This single action restores the link between URL and page content. By clicking save, you flush the rewrite rules; WordPress regenerates the instructions that tell the server where each page lives. In around 90% of cases this fixes the 404 immediately.

Test whether your page works again by visiting the URL. Often the page will load now. If so, the problem was likely a temporary “broken” permalink and you’re done. If not, no panic—move on to the next steps.
Step 2: Clear caches (plugin, CDN, and browser)
Do you have a caching plugin or use a CDN/host with cache? Make sure you clear all caches after flushing permalinks. Why? Otherwise you may still see the old situation. If the 404 page from earlier is cached, you’ll keep seeing it until the cache is refreshed.
Do the following:
- Clear the cache of your WordPress caching plugin. In many plugins this is called “Clear Cache” or “Purge All”. This forces the site to fetch the latest version of pages. Remember that some security plugins (e.g., Sucuri) or optimization plugins also cache, so disable or clear those too if relevant.
- Clear any server cache via your host. Some hosting providers (especially managed WordPress hosts) have their own caching layers. Log in to your hosting panel and purge the cache (often found under a WordPress tools section).
- Clear CDN cache (if applicable). Using Cloudflare or another CDN? Perform a Purge Cache in their dashboard, or at least for the URL in question. I’ve seen a newly published page become visible only after clearing the Cloudflare cache that stored the earlier 404.
- Force a fresh fetch in your browser. Usually not necessary, but it doesn’t hurt: perform a hard refresh (Ctrl+F5 on Windows, Cmd+Shift+R on Mac) or try the page in an incognito/private window. That way you’re sure the browser isn’t holding on to anything old.
Check the page again. If caching was the issue, it should now load normally. If not, continue.
Step 3: Check (and restore) your .htaccess file
If rebuilding permalinks and clearing caches didn’t help, the next suspect is the .htaccess file (only applicable if your host uses Apache or LiteSpeed—on NGINX you can skip this step). This hidden file in the root of your site contains important URL-handling rules. If it’s missing, has incorrect permissions, or the content is corrupted, WordPress can’t use pretty permalinks and you get 404s.
Things to check:
- Does the
.htaccessfile exist? Via FTP or your host’s File Manager, check the WordPress root (wherewp-contentis located) and make sure.htaccessis present. Ensure hidden files are visible. If it’s missing, you can recreate it. - Does WordPress have permission to write to
.htaccess? Normally WordPress updates this file when you save permalinks. If that didn’t happen, the file might not have been writable. You can temporarily check permissions (e.g., set to 644). Tip: never set permissions to 777; if you test, set to 666 briefly and then back to 644. This is only needed if step 1 clearly didn’t update.htaccess. - Are the default WordPress rules present? Open the
.htaccessfile (download and view it in a text editor). For a standard WordPress site with pretty permalinks, it should contain something like this (usually at the top):
# 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
Check whether your .htaccess contains these rules. If not, this is likely the cause of the 404s. Add the standard rules above (back up the original file first). Save and upload it to your server. That should allow permalinks to resolve correctly again.
Tip: If you’re not comfortable with FTP or editing files manually, you can also let WordPress regenerate .htaccess. Rename the current .htaccess via your hosting File Manager to something like .htaccess_old. Then in WordPress go to Settings > Permalinks and click Save Changes again. WordPress will try to create a new .htaccess with the default content. Check via FTP whether the new file appeared and test your site.
After updating or adding .htaccess, the 404 problem should be resolved if it was the cause. Try loading your page again. If it still doesn’t work, move on to step 4.
Step 4: Temporarily disable plugins (find conflicts)
If the steps above didn’t help, there’s a good chance a plugin is interfering. A plugin can register its own rewrite rules or affect permalinks (think of a multilingual plugin, a custom post type plugin, or a redirect plugin). A plugin update can also break things unexpectedly.
The easiest way to test this is to temporarily deactivate plugins:
- Deactivate all plugins in WordPress (or at least all non‑critical ones). Do this via Plugins > Installed Plugins. You can select them all at once and choose Deactivate. (Don’t worry, your content remains intact.)
- Test the page that returned 404. If it works now, the cause is a plugin.
- Reactivate plugins one by one and test each time. When the 404 returns after enabling plugin X, you’ve found the culprit.
- Leave that specific plugin disabled and reactivate the rest. Then look for a solution: maybe there’s an update or a known conflict. You can also look for an alternative if it’s a serious bug.
In many cases I’ve seen that a redirect plugin was misconfigured or that a security plugin (with its own firewall rules) blocked permalink access. Disabling the plugin fixed the issue. If you identify such a plugin, contact the developer or check the documentation for a fix. Until then, keep it disabled or use a replacement.
Step 5: Rule out other possible causes
If the 404 error persists after all of the above, there are a few less common causes to check:
- Theme issues: temporarily switch to a default WordPress theme (Twenty Twenty-* or similar) and test the page. If it works there, something in your theme code is wrong (for example a custom query or post type conflict). This is uncommon, but possible.
- Database old permalinks: in rare cases old URL references remain in the database (such as old slugs in
wp_postmeta). This can cause confusion if you created a new page with the same slug as a previously deleted one. Cleaning this up requires direct database work, which is beyond the scope of this article, but keep it in mind as a last resort (and preferably leave it to a developer). - Hosting/server issues: very occasionally the problem isn’t WordPress itself but the server configuration. For example if the Apache
mod_rewritemodule isn’t active, or there are strange cronjobs/caching at server level affecting your site. If you’ve tried everything, ask your hosting provider whether there are known issues (such as a cache that needs clearing or error log entries around the time of the 404s). - Reinstall core: as a last resort you could consider reinstalling WordPress core files (via Dashboard > Updates > “Re-install WordPress”). Corrupted core files can theoretically cause unexplained issues, although it’s unlikely they would specifically cause only 404s. Don’t forget to make a backup before such steps.
Usually you won’t need to go that far. In 99% of cases, the 404 “page not found” error in WordPress can be fixed with one of the simple steps 1–4: flush permalinks, clear cache, fix .htaccess, or disable a conflict.
404 error resolved? (Conclusion)
A 404 error in WordPress can be startling, but fortunately you can often fix it yourself with the steps above. In summary: in most cases a 404 is the result of broken permalinks and re-saving permalinks is enough to fix it. If not, clearing caches, restoring .htaccess, or finding a plugin conflict usually helps identify the culprit and makes your site accessible again.
Hopefully this guide gave you the confidence and practical steps to solve the 404 Not Found message yourself. Nobody wants to lose visitors (or customers) because of a hidden site error.
Checklist summary (TL;DR)
- Flush your permalinks via Settings > Permalinks (and click Save Changes).
- Clear all caches (plugin, hosting, CDN) so you’re not seeing an old error.
- Check
.htaccessfor the correct contents; restore or recreate it if needed. - Disable plugins to identify conflicts (especially recently added or caching/SEO plugins).
- Verify the page is published and the URL is correct (basic check).
- Still not working? Consider professional help.
If all goes well, your 404 problem is now in the past. Good luck building your WordPress site without frustrating errors!