Web server rules
- Examples from the WordPress handbook
.htaccessrules such asRequire all deniedandRewriteRule ... [F]; nginxdeny all- Where to look
.htaccess, vhost or nginx config
Fix a WordPress 403 Forbidden: find the refusing rule in .htaccess, server blocks, security plugins, firewalls, wp-admin protection or REST API nonces.
A WordPress 403 Forbidden means the web server or a security layer refused the request before or while WordPress ran. Look at .htaccess rules and server blocks that deny paths, a security plugin or firewall, password protection on /wp-admin/, and for REST calls a missing nonce. Find the rule in the server error log; deactivate plugins to rule out a plugin.
Four quick questions, then a straight answer.
From your answers, this is quietly costing you traffic and nobody has the hours to chase it. Scaplet finds every affected page, drafts the fixes and tracks how AI answers mention you.
A data platform shipped 46 fixes without a ticket.
This looks handled. Re-check after a redesign, a migration or a big content push; that is when it breaks.
Your site is small and you have the time. Work through the steps on this page, starting with the pages that get the most traffic.
.htaccess rules such as Require all denied and RewriteRule ... [F]; nginx deny all.htaccess, vhost or nginx config.htaccess, or act inside WordPress, plus ModSecurity/wp-admin//wp-admin/.htaccess and host panel settingsThe server's own error log names the rule for server-level denials. For Apache see 403 Forbidden in Apache and for nginx 403 Forbidden in nginx.
<FilesMatch "^(wp-config\.php|\.htaccess|\.htpasswd|debug\.log)$">
Require all denied
</FilesMatch>RewriteRule ^wp-admin/includes/ - [F,L]
RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]location ~ /\. {
deny all;
}
location ~* /(?:uploads|files)/.*\.php$ {
deny all; # PHP in uploads is refused on purpose
}If a plugin or theme asks a visitor to load a .php file from uploads, or a script from wp-includes, the 403 is the rule doing its job, not a bug in WordPress. Move the script out of the blocked path. Note also that a hidden-file rule blocks paths that start with a dot. If you add the wp-includes rewrite rules yourself, the handbook says to place them outside the # BEGIN WordPress and # END WordPress lines so WordPress does not overwrite them, and warns that the wp-includes/[^/]+\.php$ rule stops ms-files.php from generating images on Multisite.
If the 403 started after you edited .htaccess or a plugin rewrote it, restore the default rules. WordPress's handbook says its .htaccess page may be used to restore a corrupted file, for example after a misbehaving plugin. Rename the file to .htaccess_old, load the site, then re-save Settings > Permalinks to get a fresh copy. The default block is on 404 Not Found in WordPress.
wp-content/plugins to plugins.hold over FTP or in your host's file manager, test, and rename it back. WordPress's hardening guide notes that firewall plugins either modify .htaccess to restrict access at the Apache level or act inside WordPress, and that a web server WAF such as ModSecurity or a reverse proxy service can filter requests before WordPress sees them. A 403 that appears for your IP and not for others can point here.Hardening can break things. The handbook says server-side password protection on /wp-admin/ can break parts of WordPress such as the AJAX handler at wp-admin/admin-ajax.php. Ensure that file stays reachable. For an IP allow list it shows a RequireAny block with Require ip lines; a visitor outside the list is denied.
For the REST API: the standard login method is cookie authentication, and requests need a nonce, sent as the X-WP-Nonce header or the _wpnonce parameter. Without one, WordPress sets the current user to 0, which turns the request into an unauthenticated one even if you are logged in, so an endpoint that requires a user can refuse it.
Google does not index URLs that return a 403 and drops those already indexed; see 4xx errors.
Run curl -sI against the failing URL and note the status.
Restore .htaccess, deactivate plugins, or loosen one rule, then test again.
The server error log should stop showing a denial for that path.
4 questions people ask next, answered from the sources on this page.
Read the server error log for the rule that refused the request. Restore the default .htaccess rules, deactivate plugins (rename wp-content/plugins if you cannot log in), and check any firewall, WAF or /wp-admin/ protection. Test after each change.
A 403 on /wp-admin/ or the login page can come from a security plugin, a firewall, password protection on /wp-admin/, or an IP allow rule. Deactivate plugins first, then check /wp-admin/.htaccess and your host's firewall.
Send the nonce with cookie-authenticated requests, as the X-WP-Nonce header or _wpnonce parameter. Without it WordPress sets the current user to 0, so the request is unauthenticated even if you are logged in.
It can, if a firewall or IP rule refuses your address. Test from another network, and ask your host to check the firewall log.
Run the free audit, then approve the fixes. Every change can be undone.