Troubleshooting · Troubleshooting
How to Fix the 403 Forbidden Error in WordPress
Short answer
Fix a WordPress 403 Forbidden error by working in order: check file permissions, rebuild a damaged .htaccess file, test with security plugins off, then check Cloudflare or host firewall rules. The error means the server understood the request but refused access, so the fix is to find which rule or permission is refusing it and correct that one item.
Key takeaways
- A 403 error means the server understood the request but refused access to the page or file.
- WordPress directories should be 755 and files should be 644, with wp-config.php at 440 or 400.
- A damaged .htaccess file can block the whole site, and saving permalinks rebuilds the WordPress part.
- Wordfence can show a 403 when a firewall rule is triggered, and its Live Traffic page names the blocked request.
- Cloudflare returns a 403 for WAF blocks and for error 1020, when a security rule with a Block action matches.
- Hotlink Protection can block images on other sites while the page itself still loads.
What does the 403 Forbidden error mean in WordPress?
A 403 Forbidden error means the server understood your request but will not let you see the page, file, or dashboard area you asked for.
Cloudflare describes the 403 Forbidden status as a request the server understood but cannot fulfil because of insufficient permission to access the requested resource, as of November 2026 (Cloudflare Error 403).
A 403 is not the same as a page that does not exist. The file or page is often present, but a permission, a rule in .htaccess, or a security rule stops the server from serving it.
You may see the error on the whole site, on wp-admin only, on one page, or on single images. Where it appears is your best clue about the blocking layer.
What causes a 403 error on a WordPress site?
The most likely causes are wrong file permissions, a damaged .htaccess file, a security plugin rule, a Cloudflare rule, or a host firewall rule.
WordPress support threads list the same short set again and again: a plugin, the .htaccess file, and file permissions in WordPress (WordPress.org support on 403 errors). Start with those three before you look at deeper server settings.
| Cause | Where it blocks | First sign |
|---|---|---|
| Wrong file permissions | Whole site or one folder | Error after a move, restore, or upload |
| Damaged .htaccess file | Whole site or wp-admin | Error after a plugin change or edit |
| Security plugin rule | wp-admin, login, or one action | Error only when you save or submit |
| Cloudflare WAF rule | Whole site or one URL | Cloudflare-branded error page |
| Hotlink Protection | Images only | Page loads but images do not |
| Host firewall or mod_security | Whole site or one action | Error after a host change |
Cloudflare also lists permission rules on the origin server, mod_security rules, and IP deny rules as common causes of a 403 without Cloudflare branding (Cloudflare Error 403).
How do you tell if the 403 comes from WordPress, your host, or Cloudflare?
Look at the error page itself, because a Cloudflare-branded page points to Cloudflare and a plain server page points to your host or WordPress.
Cloudflare states that a 403 without Cloudflare branding is returned directly by the origin web server, not by Cloudflare (Cloudflare Error 403). That one detail splits the job in half.
Use this quick check before you change anything:
- If the page shows Cloudflare branding or an error code such as 1020, check Cloudflare first.
- If the page is plain and shows “Forbidden” or “You do not have permission to access this resource”, check permissions and .htaccess first.
- If only wp-admin or wp-login.php fails, check security plugins and login protection first.
- If only images fail, check Hotlink Protection and the uploads folder permissions first.
If you are unsure which layer is at fault, our guide on how to use AI to fix WordPress errors can help you sort the symptoms before you change files.
How do you fix wrong file permissions that cause a 403?
Set directories to 755, files to 644, and wp-config.php to 440 or 400, then test the page again.
WordPress developer docs state that all directories should be 755 or 750 and all files should be 644 or 640, with wp-config.php at 440 or 400 to stop other users on the server from reading it, as of November 2026 (Changing File Permissions).
The same docs warn that no directory should ever be given 777, even upload directories (Changing File Permissions). A 777 setting lets every user on the server read, write, and run files in that folder, so it trades a short-term fix for a clear security risk.
Fix permissions in your host file manager
- Back up the site before you change permissions.
- Open the file manager in your hosting control panel, or connect by SFTP.
- Select the WordPress root folder and set folders to 755.
- Set files to 644, and set wp-config.php to 440 or 400.
- Check the wp-content/uploads folder and set it to 755 if images fail.
- Reload the page that showed the 403 error.
If you use SSH, WordPress docs give the same values as commands for folders and files (Changing File Permissions). Ask your host to run them if you do not have SSH access.
File ownership matters as well as the numbers. WordPress docs state that all files should be owned by your user account on the web server, not by the web server process itself (Changing File Permissions).
How do you fix a broken .htaccess file?
Rename the current .htaccess file, then open Settings then Permalinks in WordPress and click Save Changes so WordPress builds a fresh one.
The .htaccess file sits in the WordPress root folder and controls rewrite rules, including permalinks. A wrong deny rule or a broken rewrite rule in that file can return a 403 for the whole site or for wp-admin.
Rebuild .htaccess safely
- Back up the site, then download a copy of .htaccess if you can.
- Connect by SFTP or open the host file manager and show hidden files.
- Rename .htaccess to .htaccess-backup.
- Load the site. If it loads, .htaccess was the cause.
- In WordPress, go to Settings, then Permalinks, and click Save Changes.
- WordPress creates a fresh .htaccess file with the standard rewrite rules.
Apache docs note that a RewriteRule with the [F] flag sends a 403 Forbidden response, so a rewrite rule can block a request on purpose (Apache Access Control). Look for Deny, Require, and RewriteRule lines with [F] in the backup file before you restore any old rules.
How do you check if a security plugin is blocking you?
Rename the security plugin folder by SFTP, reload the site, and if the 403 is gone, the plugin or one of its rules was the cause.
Wordfence states that its message "403 Forbidden. A potentially unsafe operation has been detected in your request to this site" means Wordfence blocked the request for breaking a firewall rule (Wordfence Blocking Troubleshooting).
Test a Wordfence block
- Note the exact time and the URL that returned the 403.
- In WordPress, open Wordfence, then Tools, then Live Traffic.
- Find the blocked request in the feed and read its reason.
- If the request is safe, add it to the allowlist from that page.
- If you cannot reach wp-admin, rename wp-content/plugins/wordfence by SFTP.
- Reload the site, then rename the folder back only after you have a fix ready.
Wordfence also warns that an IP address on its Real-Time IP Blocklist can see a 403, and the block page offers a form to report a wrong block (Wordfence Blocking Troubleshooting). On a shared VPN address, another user may have caused the block.
For the full firewall setup, see our Wordfence firewall setup guide. It explains the firewall modes and the settings that most often cause a false block.
How do you fix a 403 from Cloudflare or a firewall rule?
Find the blocked request in the Cloudflare Security Events log, read which rule blocked it, then change that rule or add an exception for the safe request.
Cloudflare states that it may serve a 403 when a request breaks a default WAF managed rule or a custom WAF rule for your zone (Cloudflare Error 403). Cloudflare also lists its Security Level setting, which defaults to Medium, as a trigger for a branded 403 page.
Check Cloudflare error 1020
Cloudflare error 1020 is a Cloudflare security feature blocking a request, and Cloudflare returns it with an HTTP 403 status code (Cloudflare Error 1020).
- Ask the visitor for a screenshot that shows the Ray ID.
- In Cloudflare, go to Security, then Analytics, then the Events tab.
- Search the log for the Ray ID or the visitor IP address.
- Read which feature and rule blocked the request.
- Change that rule, or add an exception for the safe request.
Our Cloudflare WAF rules guide explains how managed and custom rules work on a WordPress site.
If you are new to Cloudflare, start with our Cloudflare setup guide for WordPress before you change WAF settings.
Why do images show a 403 when the page loads fine?
Hotlink Protection or wrong permissions on the uploads folder can block image files while the page itself still loads.
Cloudflare states that Hotlink Protection stops other sites from using your images, which can cut the bandwidth used by your origin server (Cloudflare Configuration Rules). The same setting can also block images that load from a different domain you own, such as a staging site or a second domain.
Check the uploads folder first. WordPress docs state that some plugins need the wp-content folder to be writable, and in some cases this needs 755 permissions (Changing File Permissions).
To test Hotlink Protection, open the image URL directly in a browser tab. If it loads there but fails when embedded on another site, Hotlink Protection is the likely cause.
How do you fix a 403 on wp-admin or wp-login.php only?
A 403 on wp-admin or wp-login.php only points to a login rule, a security plugin, or a deny rule in .htaccess, not to a site-wide permission fault.
Wordfence states that a lockout after too many failed logins lasts for the time set in its Brute Force Protection options, and the block page offers an email to restore your own access (Wordfence Blocking Troubleshooting).
Try these steps in order:
- Wait a few minutes, then try to log in once from a different network.
- Check Wordfence Live Traffic for the blocked login request.
- Look in .htaccess for a Deny rule that covers wp-login.php or wp-admin.
- Rename the security plugin folder by SFTP if you cannot reach wp-admin at all.
- Ask your host to check mod_security rules for wp-admin requests.
WordPress docs note that WP_DEBUG_LOG writes errors to wp-content/debug.log when WP_DEBUG is true, which can show the failing request (Debugging in WordPress). Add the debug lines near the end of wp-config.php, test once, then set WP_DEBUG back to false.
How do you know the 403 is fixed?
The fix is confirmed when the same page loads with a 200 status in a fresh browser session, with no cache in the way.
Test in this order:
- Reload the exact URL that showed the 403 error.
- Open the same URL in a private or incognito window.
- Test wp-admin and one image URL from the uploads folder.
- Ask a second device or network to load the page.
- Clear the Cloudflare cache if you use Cloudflare, then test again.
A cached 403 page can look like a failed fix, so test with a fresh session and a cleared cache before you undo a fix that worked.
When should you contact your host?
Contact your host when the 403 affects the whole site, when permissions and .htaccess are correct, or when the block comes from a server rule you cannot see.
Cloudflare lists mod_security rules and IP deny rules as origin-server causes, and it warns to make sure Cloudflare IP ranges are not blocked (Cloudflare Error 403). Those rules live on the server, so only your host can read or change them.
Send your host this short list: the exact URL, the time of the error, your IP address, the Ray ID if Cloudflare showed one, and what you already changed. That list lets support check the server error log for the exact blocked request.
If your host finds a mod_security rule that blocks a safe WordPress action, ask them to add an exception for that rule rather than turning the firewall off.
What mistakes should you avoid?
Do not set folders to 777, do not delete .htaccess without a backup, and do not turn off every security rule to clear one 403.
WordPress docs warn that no directory should ever be given 777, even upload directories, because the PHP process can write to a 755 folder (Changing File Permissions).
Other common mistakes:
- Restoring a full old .htaccess file without checking which rule caused the block.
- Leaving WP_DEBUG on after testing, which can show error details to visitors.
- Allowlisting your own IP in Wordfence and forgetting to fix the rule that blocked other visitors.
- Changing Cloudflare WAF rules for the whole site when only one URL needs an exception.
For Wordfence settings that often cause false blocks, see our Wordfence settings guide. Change one setting at a time, test, and keep a note of what you changed.
Frequently asked questions
Is a 403 Forbidden error the same as a 404 error?
No. A 404 means the server could not find the page, while a 403 means the server found it or understood the request but refused access. A 403 points to permissions, a rule in .htaccess, or a security rule, while a 404 points to a missing page or a broken link.
Can a 403 error go away on its own?
Sometimes, yes, if it came from a short lockout after too many failed logins or a short block on a shared IP address. A 403 from wrong permissions, a damaged .htaccess file, or a firewall rule will not clear on its own. You need to fix the permission, the file, or the rule.
Will deactivating all plugins fix a 403 error?
It can help you find the cause, but it is a test, not a fix. Rename the plugins folder by SFTP or rename one plugin folder at a time, then reload the site. If the error clears, reactivate plugins one by one until it returns, then fix or replace the plugin that caused it.
Why does Cloudflare show a 403 for some visitors only?
Cloudflare rules can block by IP address, country, browser check, or request pattern, so one visitor can be blocked while others load the site fine. Check the Security Events log for the blocked visitor Ray ID or IP address, then read which rule matched and add an exception if the request is safe.
Should I set file permissions to 777 to fix a 403?
No. WordPress docs say no directory should ever be given 777, even upload directories. Use 755 for directories and 644 for files, with wp-config.php at 440 or 400. If those values do not work, the cause is usually file ownership or a server rule, so ask your host to check it.
Sources
- Changing File Permissions WordPress Developer Resources
- Error 403 Cloudflare Docs
- Blocking Troubleshooting Wordfence
- Error 1020: Access denied Cloudflare Docs
- Debugging in WordPress WordPress Developer Resources
- Access Control Apache HTTP Server Documentation
- Configuration Rules settings Cloudflare Docs
Is your product missing, or something out of date?
Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.
Thanks — we review requests within 3 business days.
