A WordPress 403 Forbidden error means the server received the request, understood it, and refused to serve it. Nothing crashed, which is what separates it from a 500 error: something between the visitor and WordPress decided the answer is no. To fix a 403 Forbidden error in WordPress, first find out which layer said no (the CDN or firewall in front of the site, the web server, or WordPress itself), because each one is fixed in a different place.
Every output in this checklist comes from a disposable test server running WordPress 7.1.3 on PHP 8.2 with Apache 2.4.69, where each cause was triggered on purpose and the real response and log line recorded. You need SSH or SFTP access to the site, and for the last step, access to the server’s error log.
Step 1 Find out which layer sent the 403
Ask for the response headers only:
curl -sI https://example.com/wp-admin/
The Server header and the page body tell you who answered. A 403 from Apache looks like this, and its page says nothing more than “You don’t have permission to access this resource”:
HTTP/1.1 403 Forbidden
Server: Apache/2.4.69 (Debian)
Content-Type: text/html; charset=iso-8859-1
A 403 from Cloudflare says server: cloudflare, and when a firewall rule issued a challenge it also carries a cf-mitigated header. This is a real response from the login protection rule on wptutshub.com itself:
HTTP/2 403
content-type: text/html; charset=UTF-8
cf-mitigated: challenge
server: cloudflare
Use what you see to decide where to start:
server: cloudflare(or another CDN’s name): the request never reached your server. Go to step 4.- An Apache or nginx
Serverheader with the plain “Forbidden” page: the web server refused it. Work through steps 2, 3 and 5. - A page branded by a security plugin, or a JSON body such as
{"code":"rest_forbidden",...}: WordPress or a plugin refused it. Go to step 4 and the section on WordPress’s own 403s.
Step 2 Check file and folder permissions
The web server user (www-data on Debian and Ubuntu, apache on RHEL-based systems, or your own account on most shared hosting) must be able to read every file it serves and enter every folder on the way to it. The WordPress standard is 755 for folders and 644 for files. Most 403s after a migration, a restore from backup or an FTP upload come from files and folders that lost those modes.
When a file cannot be read, Apache answers 403 and logs exactly why:
$ curl -sI https://example.com/readme.html
HTTP/1.1 403 Forbidden
Server: Apache/2.4.69 (Debian)
[core:error] (13)Permission denied: [client 203.0.113.10:51234] AH00132: file permissions deny server access: /var/www/html/readme.html
A folder without the execute (x) bit is worse: it breaks every file inside it, even files that are readable themselves. Apache cannot even look for an .htaccess file in that folder:
$ curl -sI https://example.com/wp-includes/css/dashicons.min.css
HTTP/1.1 403 Forbidden
Server: Apache/2.4.69 (Debian)
[core:crit] (13)Permission denied: [client 203.0.113.10:51234] AH00529: /var/www/html/wp-includes/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/var/www/html/wp-includes/' is executable
Before changing anything, list what is wrong. Run these from the WordPress root:
# Folders that are not 755, and files that are not 644
find . -type d ! -perm 755 -print
find . -type f ! -perm 644 -print
On the test site, with a theme folder and a core file broken on purpose, the audit printed:
$ find . -type d ! -perm 755 -print
./wp-content/themes
./wp-content/cache
$ find . -type f ! -perm 644 -print
./wp-includes/version.php
Fix everything in one pass, then run the audit again. Both lists should come back empty:
find . -type d -exec chmod 755 {} +
find . -type f -exec chmod 644 {} +
Two cautions. Some hosts deliberately set wp-config.php to 640 or 600 so other accounts on the server cannot read your database password. If yours was like that, set it back after the bulk fix. And modes are only half the check: if the files belong to the wrong user after a migration, 644 does not help when the web server is neither the owner nor in the group. ls -l shows the owner. On a VPS, sudo chown -R www-data:www-data /var/www/html fixes it; on shared hosting, the host’s file manager or support does.
Step 3 Audit the .htaccess file
On Apache, .htaccess rules apply to every request in that folder and below, and several common rules answer with 403. Rename the file to see whether it is involved:
mv .htaccess .htaccess.bak
On the test site, a single Require all denied line blocked the whole site, and renaming the file brought it back at once:
$ curl -sI https://example.com/
HTTP/1.1 403 Forbidden
[authz_core:error] [client 203.0.113.10:51234] AH01630: client denied by server configuration: /var/www/html/
# after renaming .htaccess
HTTP/1.1 200 OK
AH01630 is the line to look for whenever an access rule is the cause: Require all denied, a Require ip list that leaves your own address out, old Order / Deny from rules copied from Apache 2.2 tutorials, and the hotlink protection or “block bad bots” snippets some security plugins write into this file.
If renaming fixed it, start again from the standard WordPress block and add your other rules back one at a time until the 403 returns. That last rule is the culprit:
# 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
One rule deserves a special mention. Pretty permalinks depend on mod_rewrite, and Apache refuses rewrites in a folder where symbolic links are switched off. A line such as Options -FollowSymLinks, often copied from hardening guides, makes every permalink return 403 while the home page and static files keep working:
$ curl -sI https://example.com/sample-page/
HTTP/1.1 403 Forbidden
[rewrite:error] [client 203.0.113.10:51234] AH00670: Options FollowSymLinks and SymLinksIfOwnerMatch are both off, so the RewriteRule directive is also forbidden due to its similar ability to circumvent directory restrictions : /var/www/html/sample-page
If you want symbolic links restricted, use Options +SymLinksIfOwnerMatch instead of switching both off.
A broken .htaccess usually looks different. A typo or an unknown directive gives a 500 Internal Server Error, not a 403, and the error log says “Invalid command”. If you are seeing 500s, that is the line to search for.
Step 4 Rule out the security plugin, the host firewall and the CDN
Security layers return 403 by design, so a false positive looks exactly like a configuration error until you check who answered.
- Security plugins. Wordfence and similar plugins show their own branded block page, which usually says what was blocked. If you can still log in, the plugin’s live traffic or firewall log names the rule, and you can allowlist that action. If you cannot reach wp-admin, rename the plugin’s folder over SFTP (for example
wp-content/plugins/wordfencetowordfence.off), fix the setting, then rename it back. - The host’s firewall. Many hosts run ModSecurity, which returns its own 403 page with no WordPress involvement. It usually fires on specific requests: saving a post that contains code, uploading a file, or submitting a form with certain words. Your host can look up the rule ID in its logs and exclude that one rule for your site.
- Cloudflare or another CDN. If the response says
server: cloudflare, open Security → Events in the Cloudflare dashboard, find the blocked request and see which rule matched. Custom rules, IP access rules and Bot Fight Mode are the usual causes.
To check whether the block is tied to your own IP address, load the site over mobile data instead of your usual connection. If it works there, the site is fine and your address is what is being blocked.
Step 5 Check the Apache configuration and the error log
If nothing so far explains it, look at the server configuration itself. On a VPS, the virtual host for a WordPress site should contain a block like this:
<Directory /var/www/html/>
Options -Indexes +FollowSymLinks
AllowOverride All
Require all granted
</Directory>
Require all granted is the line that allows access at all. A <Directory> block with Require all denied refuses everything below it, with the same AH01630 line as in step 3. -Indexes keeps directory listings off, which is right for security, but it also means a folder with no index file returns 403. That one is harmless and often mistaken for a fault:
$ curl -sI https://example.com/wp-content/uploads/2026/
HTTP/1.1 403 Forbidden
[autoindex:error] [client 203.0.113.10:51234] AH01276: Cannot serve directory /var/www/html/wp-content/uploads/2026/: No matching DirectoryIndex (index.php,index.html) found, and server-generated directory index forbidden by Options directive
AllowOverride decides whether .htaccess is read at all. With AllowOverride None, Apache ignores the file, so pretty permalinks return 404 rather than 403, and none of the rules you checked in step 3 ever ran.
Keep the error log open while you reload the failing URL:
sudo tail -f /var/log/apache2/error.log # Debian and Ubuntu
sudo tail -f /var/log/httpd/error_log # RHEL, AlmaLinux, Rocky
The AH code on the new line tells you which check applies:
- AH00132 or AH00529: permissions (step 2).
- AH01630: an access rule in
.htaccessor the virtual host (steps 3 and 5). - AH00670: symbolic links switched off while rewrites are on (step 3).
- AH01276: a folder with no index file (harmless).
- Nothing logged: the 403 came from a plugin, the host’s firewall or the CDN (step 4).
On nginx there is no .htaccess; the same rules live in the server block. Its error log, usually /var/log/nginx/error.log, says “Permission denied” for permission problems and “directory index of … is forbidden” for folders without an index file.
When WordPress itself returns the 403
Not every 403 comes from the server. WordPress returns 403 when a logged-in user lacks the capability for an action, and the REST API returns it with a JSON body when a request fails its checks, for example {"code":"rest_cookie_invalid_nonce","message":"Cookie check failed","data":{"status":403}} when a nonce has expired. Permissions and .htaccess have nothing to do with these. If one of your own endpoints is refusing requests, securing custom REST API endpoints with nonces and capability checks shows what WordPress expects. If a security plugin turned out to be the cause, the guide to the best WordPress security plugins covers which ones are worth keeping.
The checklist in short
- Run
curl -sIand read theServerheader to see which layer refused. - Audit permissions with
find: 755 for folders, 644 for files, and the right owner. - Rename
.htaccess; if that fixes it, rebuild it from the WordPress block one rule at a time. - Check the security plugin, the host’s firewall and the CDN’s event log.
- Read the Apache error log and match the
AHcode to the cause.
Leave a Reply