What is forbidden error 403 and when you see it? What causes this error to show for WordPress websites? How to fix the forbidden error 403 in WordPress? If you face this error and want to fix it, we recommend you to read this article.
One of the common errors in WordPress is forbidden error 403. When you enter your website and see this error it means that there are some false settings on your website and you need to fix them. Each folder and file on a website has an access permission number that can allow reading and executing it. Although error 403 can be troublesome, it’s easily fixed. This error is displayed differently on every operating system and browser. They are commonly displayed as:
Forbidden 403, HTTP 403, Forbidden, Error 403 and HTTP error 403.14-Forbidden
Or in some cases, you will see Access Denied.
What is the Forbidden Error 403?
When there is an error on your website, codes will display a message on your screen. Error 403 like many other errors is related to HTTP which connects a web server to your browser. When we enter an HTTP URL in our browser, It begins to send and receives codes from a web server to display on our browser.
These codes are usually hidden from our eyes and these codes are usually known as HTTP status. When there is an error in the HTTP we will see a message saying: error 403, error not found 404, internal server error 500, bad gateway error 502 and gateway timeout error 504 these are the most common ones.
Usually, error 403 is displayed when your server doesn’t give permission to a page to be displayed. The error says the page/file you are trying to access is either deleted or you don’t have permission to view it. As mentioned above, this error is displayed when:
- You tried to access the WordPress login page or admin dashboard
- When you try to install a plugin
- When you try to visit a web page
Error 403 means your web server understands the user’s request but your server doesn’t allow it.
Why do I see Forbidden Error 403?
One of the main reasons for forbidden error 403 in WordPress is weak security measures of security plugins. Security plugins are designed in a way to block any suspicious and dangerous IP from accessing your website. This is why the Sucuri plugin is highly recommended.
Another reason is due to some errors in the .htaccess file. Sometimes your hosting provider makes unexpected mistakes when creating your server. These mistakes can cause error 403.
How to Fix Forbidden Error 403?
Now that you know what causes error 403 you can begin to resolve it. Before doing anything we recommend you to fully backup your website in case anything goes wrong.
Review and Fix Plugins
As mentioned above, security plugins can cause this error. To make sure that your security plugins are causing this error, follow these steps:
- Disable all of your plugins
- Enable one of your plugins
- Visit your web pages and see if you still get error 403
- Keep repeating this cycle until you find the plugin that is causing this error and once found, completely remove it
Fix the .htaccess file
When you disable all of your plugins and you still see forbidden error 403 it is possible that a file is causing the error. Often, .htaccess causes this error. When .htaccess isn’t created properly it will cause a lot of problems/errors for your website. Fixing this issue is very simple. First, gain access to your root directory either with “File Manager” in cPanel or any FTP clients.
Other than the ways mentioned, you can also you a plugin to gain access to your .htaccess file, this plugin is WP htaccess Control.
Once you found your .htaccess file download it on your computer so you have a copy of it in case anything goes wrong. Once downloaded, go ahead and delete the original copy from your server. Visit your website if you don’t see error 403 it means your .htaccess file was causing it, and you can head over to your WordPress settings > permalinks and click save to create a new .htaccess file.
Fix the File Permissions
If you tried the methods above and you still see forbidden error 403 then it means there is a mistake with your permissions. To fix this issue you can ask your hosting provider to review your permissions. Most hosting providers offer excellent support and will help you with any problems you may have. If you try to change permissions you may cause even bigger problems. Therefore, if you are unaware of how these permissions work, we recommend you to leave it to experts.
Every single file on your server has its own permissions. These permissions define who can access your files and folders. When these permissions are set incorrectly it will cause error 403 and your web server may think you don’t have access to these files.
If you wish to change the permissions follow the steps below. Connect to your root directory with any FTP clients. Select a folder by clicking on it, then right-click and select “File Permissions”. Every folder on your website must have 744 or 755 permissions. Every file on your WordPress must have 644 or 640 permissions. You can set your folders permissions in the root directory to 744 or 755.
First, you need to tick “Recurse into subdirectories” and “apply to directories only” and click OK. By doing so your FTP client will begin to make the changes. When it’s finished, you will have to do this for every single folder and file on your server. When you are done, error 403 will disappear.