WordPress 403 Forbidden error: how to find what is actually blocking you

A 403 on WordPress comes from six places, and the fix depends entirely on which. How to tell them apart in minutes, with the checks for each.

Our content is written and reviewed by the Four Cents team. We may recommend our own services. Read our editorial standards.

On this page

The refusal is deliberate, so the whole job is finding out which layer decided to refuse, because there are six candidates and the fixes have nothing in common.

What a 403 actually means

The server understood your request, identified what you wanted, and refused. Something made a decision. Your job is to find which layer made it, and there are only six realistic candidates.

That framing matters because a 403 is the error people most often try to fix by guessing. Resetting permissions when a security plugin blocked your IP changes nothing, and resetting them to 777 makes the site insecure and frequently still returns 403, because many hosts refuse to execute world-writable files.

Narrow it in two minutes before changing anything

Four questions. The answers eliminate most of the six causes immediately.

QuestionIf yes, look at
Is it the whole site, every URL?File rules, permissions, or an index problem
Only /wp-admin or wp-login.php?Security plugin lockout, or an admin-specific rule
Only one URL or one action?mod_security at the host, or a rule matching that request
Only for you, while others are fine?Your IP is blocked. Almost always this

Test the last one properly: load the site on mobile data with wifi off, which gives you a different IP. If it works there and not on your network, you have your answer and the fix is an allowlist entry, not a file change.

# see the actual status and which server answered
curl -sI https://example.com/ | head -20
curl -sI https://example.com/wp-admin/ | head -20

# compare a normal browser request with a bare one, since some rules
# refuse requests with no user agent
curl -sI -A "Mozilla/5.0" https://example.com/ | head -5

Response headers often name the culprit. A server or x-powered-by header from a security product, or a body mentioning a firewall, tells you where to look without any guessing.

Thinking about a new WordPress website?Get a free consultation and a fixed-scope quote. A senior engineer replies within 24 hours. No obligation.
Get a Free Quote

The six causes, in order of how often they are the answer

  1. A rule in .htaccess or the server config. Either added deliberately, written by a plugin, or corrupted.
  2. Wrong permissions or ownership. Common immediately after a migration or a restore from backup.
  3. A security plugin lockout. Failed logins, a country block, or a rule you forgot was on.
  4. Host-level mod_security. Returns 403 on requests matching its signatures, including some legitimate admin posts.
  5. Hotlink protection or a missing directory index. Affects specific assets or directory URLs.
  6. A compromise. Injected rules, or a file that should not be there. Rare, but check if nothing else fits.

File rules: test by renaming, never by editing blind

On Apache and LiteSpeed, .htaccess is the first place to look. The safe test is to take it out of play rather than guess at a line.

# keep a copy, then neutralise it
cp .htaccess .htaccess.broken
mv .htaccess .htaccess.off

# test the site, then restore either way
mv .htaccess.off .htaccess

If the 403 disappears with the file renamed, the cause is in it. Restore it and let WordPress write a clean one: go to Settings, then Permalinks and press Save without changing anything, which rewrites the WordPress block correctly.

Then read what you kept in the copy. You are looking for a Require or deny directive, an Options -Indexes on a directory being requested, a RewriteRule returning [F], or a <Files> block covering more than intended. Also check for a second .htaccess inside wp-admin or wp-content, because a nested one overrides the root for that directory and is easily forgotten.

# find every .htaccess under the site, not just the root
find . -name ".htaccess" -type f -exec echo "--- {}" ; -exec cat {} ;

On nginx there is no .htaccess, so the equivalent lives in the server block and you will usually need the host to read it. Say that you are getting a 403 and ask them to check the error log for your IP and timestamp.

Permissions and ownership

The standard is directories 755, files 644, and wp-config.php tighter at 640 or 600.

# see what you actually have
ls -la | head -20
stat -c "%a %U:%G %n" wp-config.php index.php wp-admin wp-content

# reset to the normal defaults
find . -type d -exec chmod 755 {} ;
find . -type f -exec chmod 644 {} ;
chmod 640 wp-config.php

Run those two find commands from the WordPress root and nowhere else. Run them a directory too high and you will change permissions across unrelated files.

Ownership matters as much as the mode and is missed more often. After a migration or a restore, files frequently end up owned by root while the web server runs as something else. The mode looks right and the server still refuses.

# who owns the files, and who does the web server run as
ls -ld . wp-content
ps -eo user,comm | grep -E "apache|httpd|nginx|php-fpm" | sort -u

If those disagree, ask your host to correct ownership. Do not guess at a chown on shared hosting.

Never use 777. It makes every file writable by anything on the server, and many hosts refuse to execute world-writable PHP, so it causes 403s as well as creating a serious security problem.

Ready to bring your WordPress project to life?Get a free consultation and a fixed-scope quote. A senior engineer replies within 24 hours. No obligation.
Get a Free Quote

Security plugins, firewalls and the host

If the 403 is admin-only, or only affects you, start here. A lockout after failed logins is the single most common cause of an admin-only 403, and the person locked out is usually the one who typed the password wrong three times.

You can reach the lockout list without logging in, if you have file or CLI access, by disabling the plugin temporarily.

# which security plugins are active
wp plugin list --status=active --fields=name,version | grep -iE "wordfence|security|firewall|ithemes|sucuri|aios|limit-login"

# turn one off just long enough to confirm it is the cause
wp plugin deactivate the-plugin-name
# ...test the admin, then
wp plugin activate the-plugin-name

With no CLI, rename the plugin's folder inside wp-content/plugins to disable it, then rename it back. Use this to confirm the cause, then fix it properly in the plugin's settings by allowlisting your IP rather than leaving protection off.

If every one of your own checks comes back clean, it is probably the host. Ask them directly: "I am getting a 403 at this URL, at this time, from this IP. Can you check the mod_security log?" That phrasing gets a useful answer, because host firewalls commonly block legitimate admin requests such as saving a long post or a page builder layout, and the entry is sitting in a log you cannot see.

What a 403 is not

Ruling out saves more time than guessing. None of these produce a true 403.

SymptomNot a 403, but
White screen with no errorA PHP fatal error. Read the log, not the permissions
Page not found404: permalinks or a missing page
Site briefly unavailable for maintenanceA stuck update. See our guide below
Too many redirectsA redirect loop, usually a URL or SSL mismatch
Error establishing a database connectionCredentials or the database server, nothing to do with permissions
403 only in one browserA cached response or an extension. Try a private window first

That last row catches people regularly. Browsers cache error responses, so a 403 you already fixed can persist on your machine alone. Check in a private window before concluding the fix failed.

For the adjacent errors, see stuck in maintenance mode and too many redirects.

A rule in a server file is behind a large share of unexplained 403s, including rules a security plugin wrote without telling you. Our page on the WordPress .htaccess file lists the default rules from core and the ones worth keeping.

Want a clear plan and price for your website?Get a free consultation and a fixed-scope quote. A senior engineer replies within 24 hours. No obligation.
Get a Free Quote

The order to work through it

  1. Establish the scope: whole site, admin only, one URL, or only you
  2. Try mobile data. If it works, your IP is blocked and you are done
  3. Check response headers with curl -sI for a product name
  4. Rename .htaccess, test, restore, and resave permalinks
  5. Check permissions and ownership against the defaults above
  6. Disable security plugins one at a time, confirming each
  7. Ask the host to read the mod_security log with your IP and timestamp
  8. If nothing fits, treat it as a possible compromise and scan

Steps one and two solve a large share of cases in under five minutes and cost nothing. Do them before touching a single file.

If you are stuck at step seven with a site that is down, that is a reasonable point to hand it over. We fix WordPress sites that are returning errors and tell you what caused it rather than just clearing it. Send us the URL and what you see.

Frequently asked questions

What causes a 403 Forbidden error in WordPress?

Six things, in rough order of frequency: a rule in .htaccess or the server config, wrong file or directory permissions, a security plugin or firewall blocking your IP or request, hotlink or directory-index protection, mod_security rules at the host, or an ownership mismatch after a migration.

How do I tell which cause it is?

Narrow by scope first. One URL, the whole admin, the whole site, or only for you? A site-wide 403 points at file rules or permissions. Admin-only usually means a security plugin. Only for you almost always means your IP was blocked.

Why do I get a 403 only on wp-admin?

Usually a security plugin or firewall rule protecting the admin, often after failed logins triggered a lockout, or an .htaccess rule inside wp-admin restricting access by IP. Check the plugin lockout list before touching files.

What file permissions should WordPress use?

Directories 755 and files 644 as a normal default, with wp-config.php tightened to 640 or 600. Never 777 on anything: it is a security problem and on many hosts it causes the 403 rather than fixing it.

Can a 403 be caused by my host rather than my site?

Yes. Host-level mod_security rules commonly return 403 for requests that look suspicious, including some legitimate admin actions. If your own checks come back clean, ask the host to check the mod_security log for your IP and timestamp.

I fixed the 403 but it came back. Why?

Something regenerates the rule. WordPress and some plugins rewrite .htaccess, and a security plugin re-adds its rules on activation or update. Find what writes the rule rather than deleting it repeatedly.

About the author

Hamza Hai

Founder, Accountant & Project Manager, Four Cents

Hamza Hai is a founder of Four Cents and its accountant and project manager. She keeps projects on track and the numbers clear.

She manages timelines, scope and client communication, so there are no surprises for clients along the way.

She writes the guides on WPDeveloper.ca, including its WordPress planning guides. They draw on the quoting and scoping work she does for Four Cents clients every week.

Areas of expertise

  • Software and app project management
  • Development costing and estimates
  • Project scoping
  • Budgeting for software projects

All articles by Hamza Hai (140 on Four Cents WordPress Studio)

Reviewed by Zee, Founder & Lead Developer, Four Cents

Zee leads every Four Cents build as the senior full-stack engineer, from the first call to launch and beyond, and technically reviews the articles on this site.

Our editorial standards: who writes and reviews our articles, where our prices come from and how to report a correction.

Start here

Get a fixed quote in 24 hours

Tell us what is wrong or what you need. Within 24 hours you get a written, fixed price or the questions we need answered to give you one.

  • A reply within 24 hours
  • Fixed price agreed before any work starts
  • You own the code, content and accounts

Site down or hacked right now? Call +1 (365) 440-1786 or email info@fourcents.ca.

Request your fixed quote

Fields marked with an asterisk are required. Phone and budget are optional.

Please enter your name.

Please enter a valid email address.

Please tell us a little more (10 characters or more).

That phone number does not look right. Check it, or leave it blank.