How to Fix 404 Not Found Error in WordPress

Knowledge Base March 2026 Cybergate IT Team 5 min read
WordPress 404 not found error fix
WordPress 404 errors are almost always caused by a .htaccess issue and take under two minutes to fix.

A 404 Not Found error in WordPress means the server cannot locate the page being requested. It is one of the most common WordPress errors and, despite being alarming, is almost always caused by a misconfigured or missing .htaccess file rather than the page actually being deleted. In the vast majority of cases, the fix takes less than two minutes. This guide starts with the quickest solution and works through to more involved scenarios.

Try This First – Fixes 90% of Cases

Log into your WordPress admin panel. Go to Settings > Permalinks. Without changing anything, simply click the Save Changes button. WordPress will regenerate the .htaccess file with the correct rewrite rules. Check your site immediately. Most 404 errors resolve with this one action.

Why Does WordPress Get 404 Errors?

Understanding the cause makes troubleshooting faster. WordPress uses a feature called Pretty Permalinks – human-readable URLs like /about-us/ instead of /?page_id=2. These friendly URLs only work because of rewrite rules in a file called .htaccess in your WordPress root directory. This file tells the web server to route all requests through WordPress’s index.php, which then serves the correct page.

When this file is missing, corrupted or has incorrect rules, all URLs except the homepage return 404. The homepage works because it loads through index.php directly without needing the rewrite rules.

WordPress file manager cPanel .htaccess
The .htaccess file in your WordPress root directory contains the rewrite rules that make pretty permalinks work.

Step 1: Regenerate Permalinks

This is the fix for the vast majority of WordPress 404 errors. Log into your WordPress admin panel at yourdomain.com/wp-admin. Go to Settings > Permalinks. The current permalink structure will be selected. Without changing anything, scroll down and click Save Changes. WordPress will write a fresh .htaccess file with all the correct rewrite rules.

After saving, open your website homepage in a browser and try navigating to other pages. Check your blog posts, service pages and any other internal links. If they are all working, you are done.

Step 2: Check if the .htaccess File Exists

If regenerating permalinks does not fix the issue, the .htaccess file may be missing or not writeable. Log into your hosting account’s cPanel (usually at yourdomain.com/cpanel). Open File Manager. Navigate to the public_html directory (or wherever WordPress is installed). Click Settings in File Manager and enable Show Hidden Files (dotfiles). Click Save.

Look for a file named .htaccess. If it is not there, the file is missing and needs to be created.

cPanel File Manager show hidden files
Enable Show Hidden Files in cPanel File Manager to see the .htaccess file.
WordPress .htaccess file permissions 644
.htaccess should have permissions set to 644 in cPanel File Manager.

Step 3: Create a New .htaccess File

If the .htaccess file is missing, right-click in the public_html directory in File Manager and select New File. Name it exactly .htaccess (including the dot, no extension). Click Create.

Right-click the new file and select Edit. Paste this standard WordPress .htaccess content:

# 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

Click Save Changes. Return to your website and test all pages again.

Step 4: Check File Permissions

The .htaccess file must have correct permissions for the web server to read it. In cPanel File Manager, right-click the .htaccess file and select Change Permissions. Set the value to 644 (Owner: Read Write, Group: Read, World: Read). Click Change Permissions.

Step 5: Test Plugin Conflicts

Some plugins modify .htaccess or interfere with WordPress URL routing. Go to Plugins > Installed Plugins in your WordPress admin. Click Deactivate in the bulk actions dropdown, select all plugins and deactivate them all. Check whether the 404 errors are resolved. If they are, reactivate plugins one at a time – recheck after each activation until the problematic plugin is identified.

Security Plugins and .htaccess

Security plugins like Really Simple Security, Wordfence and iThemes Security frequently add their own rules to .htaccess. Conflicts between these rules and WordPress core rules can cause 404 errors. If you recently installed or updated a security plugin before the 404 errors started, that plugin is the most likely culprit.

Need IT Support in Malaysia?

Cybergate provides WordPress website maintenance for businesses across KL, Selangor, Negeri Sembilan and Melaka. Our team is available Monday to Saturday, 9am to 6pm.

Frequently Asked Questions

This is the classic symptom of a missing or incorrectly configured .htaccess file. WordPress root index.php serves the homepage directly, but all other URL patterns rely on .htaccess rewrite rules. Fix the .htaccess file using the steps in this guide.
After migration, the .htaccess file and WordPress URLs must match the new server environment. Go to Settings > General and update both URLs to the new domain. Regenerate permalinks. Ensure mod_rewrite is enabled on the new server.
No. Regenerating the .htaccess file restores your existing page URLs to work correctly. It does not change your URLs or create new redirects. Existing Google rankings are not affected.
If Google has indexed 404 pages, submit your sitemap to Google Search Console and use the URL Inspection tool to request removal of specific 404 URLs from the Google index. Once the pages are working correctly again, Google will re-index them on the next crawl.
Yes. Cybergate provides WordPress maintenance and support including error fixes, security hardening and performance optimisation. Contact us for help.
CG
Cybergate MSP Technology
Enterprise IT support, cybersecurity and digital services for Malaysian businesses since 2014. Microsoft Partner · Fortinet Technology Partner. Learn about us

Related Articles

Leave a Comment

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

Scroll to Top