Skip to main content
Support Hours: 24/7 (technical team 11 AM to 8 PM PKT)WhatsApp: +92 313 2946143
Hosting Guides & Basics
15 min read
Updated Oct 7, 2026 • Published Oct 3, 2026

How to Fix 403 Forbidden Error in WordPress & cPanel (2026): The Ultimate Diagnostic Guide

Step-by-step technical guide to resolving 403 Forbidden errors in WordPress and cPanel. Learn how to fix corrupted.htaccess files, reset directory permissions (755/644), troubleshoot ModSecurity WAF false positives, and resolve CloudLinux CageFS blocks.

Muhammad Anees Ur Rehman
Founder & Infrastructure Architect
Share Guide:
How to Fix 403 Forbidden Error in WordPress & cPanel (2026): The Ultimate Diagnostic Guide

Understanding the 403 Forbidden Error: What Does It Actually Mean?

A 403 Forbidden error stops visitors and administrators in their tracks: 403 Forbidden: Access to this resource on the server is denied!

Unlike a 404 error, a 403 status confirms the requested file exists on disk. However, the server explicitly refuses to serve it due to authorization rules.

Common triggers include:

  1. Strict or corrupted .htaccess rewrite rules.
  2. Incorrect Linux file permissions (e.g. not 755 for folders or 644 for files).
  3. Web Application Firewall (ModSecurity) false positives.
  4. Security plugin blocks or missing directory index files.

This diagnostic guide walks you through the five most common fixes with clear step-by-step instructions.

These steps apply to any cPanel host, including Alif Host WordPress hosting.

Flowchart diagram for diagnosing and resolving 403 Forbidden errors in WordPress and cPanel.
Figure 1: Systematic diagnostic workflow for isolating root causes of HTTP 403 Forbidden errors.
  • Not a Hosting Crash: Your server and databases are online; an access-control rule is intentionally blocking the HTTP request.
  • Top Culprit: Over 60% of 403 errors in WordPress are caused by corrupted .htaccess directives or bad rewrite rules injected by security plugins.
  • Permission Mismatches: Incorrect Linux file modes (such as folders set to 777 or files set to 700) trigger Apache mod_authz_core access denials.
  • WAF False Positives: ModSecurity firewalls can misinterpret legitimate form submissions as malicious SQL injection or cross-site scripting (XSS).
Key Takeaway: A 403 Forbidden error indicates an authorization block, not server downtime. Checking .htaccess, file permissions, and ModSecurity rules resolves it quickly.

Fix #1: Regenerate Corrupted or Misconfigured.htaccess Files

By far the most prevalent trigger for 403 Forbidden errors in cPanel shared hosting is a corrupted, bloated, or misconfigured .htaccess file. Security plugins (such as Wordfence, iThemes/Solid Security, or All-in-One WP Security) frequently inject aggressive firewall directives, IP blocklists, and file execution restrictions into .htaccess. If a directive contains a syntax error or blocks valid rewrite pathways, Apache responds with an immediate 403 Forbidden.

To diagnose and restore your .htaccess file:

  1. Log into your cPanel dashboard and open File Manager.
  2. In the top right corner, click Settings and check Show Hidden Files (dotfiles), then click Save.
  3. Navigate to your website's root directory (public_html).
  4. Locate .htaccess, right-click it, and rename it to .htaccess_backup.
  5. Refresh your website in an Incognito browser tab.

If your website immediately loads, you have confirmed that .htaccess was the root cause! Now, create a fresh, clean .htaccess file in public_html with the official standard WordPress rewrite rules:

apache
# 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
Key Takeaway: Renaming.htaccess isolates whether rewrite directives caused the block. Re-saving permalinks in WordPress Settings -> Permalinks will automatically regenerate standard rewrite rules.

Fix #2: Reset Linux File and Directory Permissions (755 & 644 Rules)

On modern Linux web servers running cPanel with suPHP, FastCGI, or LiteSpeed LSAPI, strict permission standards are enforced to prevent cross-account contamination. If file permissions are misconfigured (often caused by unzipping third-party themes, transferring files via insecure FTP, or following dangerous online tutorials advising "chmod 777") the web server will strictly refuse to serve the files, throwing a 403 error:

  • All Folders / Directories must be set to 755 (drwxr-xr-x): Allows the owner to read, write, and execute, while the world and group can read and enter the folder.
  • All Files must be set to 644 (-rw-r--r--): Allows the owner to read and write, while the world and group can only read.
  • wp-config.php should be set to 600 or 640: Restricts direct database credential read access exclusively to the account owner.

If you have SSH terminal access to your hosting account, you can recursively audit and correct permissions across your entire website in 5 seconds with these two authoritative commands:

bash
# Navigate to web root
cd ~/public_html

# Reset all directories to 755
find. -type d -exec chmod 755 {} \;

# Reset all files to 644
find. -type f -exec chmod 644 {} \;

# Secure wp-config.php
chmod 600 wp-config.php

If using cPanel File Manager without SSH, inspect the Permissions column. If folders display numbers other than 0755 or files display permissions like 0777 or 0600, right-click the item, select Change Permissions, and adjust accordingly.

WordPress file and folder permission hierarchy standards (755 for directories, 644 for files).
Figure 2: Essential permission matrix to prevent 403 errors and secure WordPress configuration files.
Key Takeaway: Never set files or directories to 777. Not only does it create a severe security vulnerability, but modern hosting servers will deliberately block execution with a 403 Forbidden error.

Fix #3: Troubleshoot ModSecurity WAF False Positives

ModSecurity is an open-source Web Application Firewall (WAF) integrated into Apache and LiteSpeed web servers. It continuously inspects incoming HTTP POST and GET requests against standard OWASP Core Rule Sets (CRS) to block known attack patterns (such as SQL Injection, Remote File Inclusion, and Cross-Site Scripting).

Occasionally, legitimate WordPress operations (such as updating an Elementor layout containing custom CSS, saving raw HTML in a blog post, or submitting an e-commerce checkout form) can trigger a generic ModSecurity rule pattern, causing the firewall to instantly drop the connection with a 403 Forbidden error.

To diagnose ModSecurity false positives in cPanel:

  1. In cPanel, navigate to the Security section and click on ModSecurity.
  2. Locate your domain name and temporarily toggle ModSecurity to Off.
  3. Test the exact action that previously triggered the 403 error.

If the action completes successfully with ModSecurity disabled, you have identified a firewall false positive! Rather than leaving ModSecurity permanently disabled (which strips away your web application firewall protection), submit a support ticket to Alif Host Support with the exact timestamp and URL. Our systems engineers will inspect the server's ModSecurity audit log (/var/log/apache2/modsec_audit.log), identify the specific triggered Rule ID (e.g., Rule 941100), and whitelist that specific rule for your domain while keeping comprehensive security intact.

Key Takeaway: Temporarily disabling ModSecurity confirms whether WAF rules caused the block. Whitelisting specific false-positive rule IDs maintains robust firewall protection without disrupting website administration.

Fix #4: Deactivate Conflicting WordPress Plugins

Security and optimization plugins frequently create internal access-control restrictions that lock users out of specific pathways:

  • Wordfence or iThemes Security: May lock out your IP address if it detects multiple failed login attempts or flags rapid administrative navigation as a brute-force attack.
  • Two-Factor Authentication (2FA) Plugins: Misconfigured 2FA modules can block access to /wp-admin with a 403 response if session synchronization fails.
  • Caching & Firewall Plugins: Conflicting header rules can prevent dynamic scripts from loading.

To determine if a plugin is causing the 403 Forbidden error when you cannot log into /wp-admin:

  1. In cPanel File Manager, navigate to public_html/wp-content.
  2. Locate the plugins folder.
  3. Rename the folder to plugins_disabled.

This action instantly deactivates all WordPress plugins safely at the database layer without deleting any data or plugin configurations. If you can now access /wp-admin, rename the folder back to plugins, enter your WordPress dashboard, and activate plugins one by one until the 403 error recurs, isolating the exact offending plugin.

Key Takeaway: Renaming the wp-content/plugins directory provides an instant, fail-safe method to bypass plugin lockouts when access to the WordPress admin dashboard is blocked.

Fix #5: Verify Missing Directory Index Files in public_html

Another overlooked cause of 403 Forbidden errors occurs when a visitor requests a directory that does not contain a default index file, and Directory Browsing is disabled on the server (which is standard security best practice to prevent visitors from snooping through your file structure).

If your website's root directory (public_html) is missing an index.php or index.html file (such as after an accidental deletion or incomplete site migration) Apache attempts to generate a directory index. Because directory listing is prohibited (Options -Indexes), the server returns 403 Forbidden.

Ensure that public_html contains a valid index.php file with the standard WordPress bootstrap header:

php
<?php
define( 'WP_USE_THEMES', true );
require __DIR__. '/wp-blog-header.php';

If this file is missing, re-upload it from a clean WordPress release download or restore it from your automated cPanel backups.

Key Takeaway: A missing index.php in your web root causes the server to block directory indexing with a 403 error. Ensure your WordPress index bootstrap file is intact.
Frequently Asked Questions

Common Questions Answered

Why does the 403 Forbidden error only happen on /wp-admin and not the homepage?

When 403 errors occur exclusively on /wp-admin or wp-login.php, it almost always points to an IP restriction rule in.htaccess, a security plugin (like Wordfence) enforcing an administrative lockout, or a ModSecurity WAF rule blocking administrative cookie tokens.

Can CloudLinux CageFS cause a 403 Forbidden error?

Yes. CloudLinux CageFS creates an isolated virtual filesystem for each cPanel account. If CageFS packages become desynchronized during a server-level OS update, the virtual filesystem can lose read permissions to system binaries or PHP handlers, returning a 403 error. Contacting Alif Host support will allow an engineer to run cagefsctl --update to resolve it instantly.

Will fixing a 403 Forbidden error cause data loss on my website?

No. A 403 Forbidden error is an authorization barrier, not a data corruption event. Your database tables, uploaded media, and core content remain 100% intact throughout the diagnostic process.

How can I prevent 403 Forbidden errors from happening in the future?

Avoid setting directory permissions to 777, do not edit.htaccess manually without creating a backup, keep your WordPress plugins and themes updated, and use reputable security plugins with minimal custom.htaccess firewall injection.

Muhammad Anees Ur Rehman
Written & Audited By

Muhammad Anees Ur Rehman

Founder & Infrastructure Architect • 3+ Years Experience

Muhammad Anees Ur Rehman is the Founder and Chief Infrastructure Architect at Alif Host. With 3+ years of hands-on work in Linux web hosting, LiteSpeed server optimization, and cloud virtualization, Anees builds and runs the hosting infrastructure behind Alif Host for Pakistani businesses, e-commerce stores, and digital agencies. A staunch advocate for transparent hosting policies and local payment integration (JazzCash, Easypaisa, Raast), he regularly publishes deep-dive technical benchmarks on server response times, WordPress performance, and cyber resiliency.

LiteSpeed Web Server TuningKVM Cloud VirtualizationcPanel & WebHost Manager (WHM)
View Full Author Profile & Articles
Featured Hosting & Infrastructure

Related Hosting & Infrastructure Solutions

Free .COM on AnnualStarting at PKR 400/month

WordPress Hosting in Pakistan with LiteSpeed Cache

Optimized WordPress hosting engineered with LiteSpeed server caching, 1-click Softaculous install, free AutoSSL, and automated malware isolation.

WordPress Hosting in Pakistan with LiteSpeed Cache
Transparent PKR PricingPlans from PKR 300/month

Web Hosting Price in Pakistan: Plans in PKR

Compare web hosting plans and prices in Pakistani Rupees, with cPanel, free SSL and free migration on selected plans.

Web Hosting Price in Pakistan: Plans in PKR

Related Educational Articles

Back to Blog