HiBlog Hosting and cPanel

How to Fix the 403 Forbidden Error in WordPress and cPanel Hosting

  • A. MounesiAuthor
  • Release Date
  • 6 minutesReading time
  • 8Views
  • A. Mounesi
  • Published:
  • 6 min read
  • 8 views
How to Fix the 403 Forbidden Error in WordPress and cPanel Hosting

You click Update on a post and WordPress gives an error, or after moving your site to a new host you get 403 Forbidden instead of the home page. A 403 error means the server understood your request but won’t allow it. The real question is: who blocked the request? File permissions, the .htaccess file, a security plugin or the server’s firewall?

In this guide you’ll fix the 403 error in WordPress and on your host step by step: first you find exactly which request was refused, then you read cPanel’s error log and rule out the most common causes one by one.

Short answer: if the whole site gives 403, check folder (755) and file (644) permissions, that an index file exists in public_html and the .htaccess rules. If only saving or uploading in the dashboard fails, a security plugin or a firewall (ModSecurity or Cloudflare) usually refused the request; find the URL and time of the error and look for it in cPanel’s Errors log.

Where does a 403 error come from?

A 403 response can come from three places: a firewall in front of the site, such as Cloudflare; the host’s web server, because of file permissions, .htaccess or ModSecurity; or WordPress itself and its plugins. If a page is meant for admins only, seeing 403 as a regular user is normal; this guide is for when a page or action should work and doesn’t.

A 403 response reaching the browser from an edge firewall, the web server or the application

First, see exactly what gives the error

  • The whole site: open the home page and an inner page in a private window. If both give 403, go to permissions and .htaccess.
  • Only saving or uploading in the dashboard: a security plugin or firewall probably refused the request.
  • Only one file or folder: that file’s permissions or a rule in that folder’s .htaccess.
  • Only for one user or one connection: the user’s role in WordPress, or an IP blocked by a security plugin or firewall.

Find the failing request in Chrome

If the error happens when you click a button, press F12 on that page and open the Network tab. Tick Preserve log, click the button once and type status-code:403 in the Filter box. Click the failing row and, under Headers, note the Request URL and the time of the error. If there’s a CF-Ray line in the Response Headers, the response came from Cloudflare; keep its ID too.

The General section of the Headers tab in Chrome DevTools with the request URL and status code

The image is from the Chrome documentation (CC BY 4.0) and shows a request with a 200 response; in your failing request, the Status Code is 403.

Read cPanel’s error log

Log in to cPanel (if you don’t know the address, see How to Log In to cPanel), type Errors in the search box at the top of the page and open it from the Metrics section. Repeat the error once more and refresh the log page; compare the last lines with the same time and URL.

The Search Tools box on cPanel’s Tools page for finding the Errors log
What you see in the logMeaning
Permission denied with a file pathThat file’s or its parent folder’s permissions are wrong
client denied by server configurationA rule in .htaccess or the server configuration blocked access
Directory index forbiddenThe folder has no index file and directory listing is disabled
ModSecurity with a rule IDThe server’s firewall refused the request

If the whole site gives 403

1. Fix file and folder permissions

According to the WordPress guide, folders should be 755 (or 750) and files 644 (or 640). In cPanel’s File Manager, right-click a file or folder and see its number with Change Permissions. After a site move, permissions like 600 on files or 700 on folders are common, and they cause exactly this 403. If these numbers are new to you, read The chmod Command and Linux File Permissions.

Checking the permissions of the site’s folders and files in File Manager

2. Check the index file

If there’s no index.php or index.html in public_html, the server returns 403 instead of listing the files. This happens a lot after an incomplete move or when the files are left inside an extra folder.

3. Rebuild the .htaccess file

In File Manager, turn on Show Hidden Files from the Settings menu so .htaccess is visible. Rename it to htaccess-old and open the site. If the error goes away, the problem was in that file: in the dashboard, go to Settings → Permalinks and click Save Changes without changing anything, so WordPress writes a fresh file. Bring back any other rules you need, such as redirects, from the old file one by one. WordPress’s default section is:

# 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

More about this file is in How to Create or Edit the WordPress .htaccess File.

If the 403 only happens when saving or uploading

  • Security plugin: if the problem started after installing or updating a security plugin, look for the time and URL in that plugin’s event log. If you can’t reach the dashboard, rename the plugin’s folder in wp-content/plugins to deactivate it.
  • ModSecurity: if the Errors log mentions ModSecurity and a rule ID, send the URL, time and ID to support in a ticket so they can review that rule for your site. Don’t switch the firewall off entirely.
  • Cloudflare: if the error page shows the Cloudflare logo, open the domain in the Cloudflare dashboard, go to Security → Analytics and the Events tab, and find the event for that time or Ray ID. Cloudflare’s 403 guide covers the next steps.
  • User role: if an admin can save but an author can’t, check that account’s role under Users → All Users.

FAQ

Does clearing the browser cache fix a 403 error?

Rarely. The server sends the 403, not the browser. It only helps if an old error page is stuck in the cache, and a private window tells you that quickly.

Won’t 777 permissions solve it?

No, and it’s dangerous. On modern hosts, files run as your own user, so 777 isn’t needed; some servers even deliberately refuse to run a file or folder set to 777. 755 and 644 are correct.

HiData hosting support

If your site is on HiData’s professional cPanel hosting and you still see 403 after these steps, write the failing URL and its time in a ticket; our 24/7 support checks the web server and firewall logs for that moment. And rest easy: the host’s daily, weekly and monthly backups make every change reversible!

Share Post

hidata.org/en/blog/how-to-fix-403-forbidden-in-wordpress/
In Social Media

Add Comment

Related Articles