Regular WordPress users must have come across the forbidden error or 403 error at least once in their lifetime. It is a deadly error especially if you are a beginner. If you don’t know much about 403 Forbidden Error and how to solve it, then you have come to the right place. Usually, the error is related to wrong file permissions in WordPress.
Today we will tell you all you need to know about Error 403 so without wasting any more time, let’s dig right into it.
What Is the 403 Forbidden Error?
403 is the HTTP status code for the forbidden error. The forbidden error shows that the page that you are trying to access is not in reach and is forbidden. There could be many possible reasons for this error.
So, let us take a look at the causes of the 403 forbidden error.
What Are The Causes Of The 403 Forbidden Error In WordPress?
Here are some common causes of the Forbidden Error:
Wrong file permissions in WordPress
A 403 Forbidden occurs when WordPress do not have permission to read the requested file.
Security Plugins
As stated earlier many reasons could cause a forbidden error in WordPress. However, the most common one is poorly configured security plugins. WordPress security plugins sometimes block a particular IP address or even a whole set of IP addresses if they detect them to be malicious.
.htaccess File
One other cause of a 403 error could be incorrect file permissions or the .htaccess File of your server. Sun sometimes your WordPress website host makes changes to the server settings. This results in a 403 error on the website.
Other Causes
Other common causes of the forbidden error include empty website directory and no index page.
Now that we know what could potentially cause 403 forbidden errors in the WordPress website let’s move on and say how you can fix these issues.
How to Fix 403 Forbidden Error in WordPress?
Before we move on to the solutions first we recommend that you create a WordPress backup of your site to make sure all your data stays safe and accessible. If you already created a WordPress backup then simply move on to fixing the error.
Removing Forbidden Error Caused By File Permission
Every file stored on a website contains file permissions that control who can access the files and folders present on your site. Sometimes corrupt or incorrect file permissions can cause the forbidden error and makes the server deny you access to these files. A simple way to resolve this issue is by asking your web hosting service to fetch the correct file permissions.
Trying to change the file permissions yourself is complicated and could have serious consequences. We recommend that you ask a professional for help. However, if you do have some knowledge and experience of handling the technical side of WordPress websites then here is how you can remove incorrect file permissions.
- Connect to WordPress website with the help of an FTP client
- Now navigate to the folder containing all of your WordPress filesClick on a folder in then right-click to select file permissions from the menu
- Now you will see a file permission dialogue box
- Every folder on your WordPress site should contain file permission of 744 or 755 where has all the files on your WordPress site should contain file permission of 640 or 644
- To fix incorrect file permissions simply set the file permission to the root folder to 744 or 755
- Select the box of “Recurse into subdirectories
- Now select “Apply to all directories only
- Click on “OK” to allow the FTP client to start setting new permissions to all the subdirectories in the folder.
- Now repeat the process for all the files and instead of 744 or 755, enter 640 or 644. Similarly, instead of “apply to all directories only” select “Apply to files only”
Once you have completed the above-mentioned process try accessing your website again. The 403 forbidden error should now be resolved.
Removing 403 Forbidden Error Caused By WordPress Plugin
First of all, what you should do is temporarily deactivate all the WordPress plugins including the security plugins. Try loading the page again if this has resolved the problem that this means one of the plugins on your website was causing the forbidden error. Start activating all plugins one by one until you can reproduce the 403 error. In this way, you can identify the particular plugin that was the culprit.
Removing Forbidden Error Caused By Corrupt .Htaccess File
To remove a forbidden error caused by a corrupt .htaccess file, simply repair the file. Repairing an .htaccess file is very easy. Connect your WordPress website to the computer with the help of an FTP client or the file manager in the control panel. Now, locate the .htaccess file in the folder of your WordPress site and download it on your computer. This will create a fresh backup of the file. The next step is to delete the .htaccess file from your server.
Access your website again and see if the error is resolved. If the 403 forbidden error is gone that means .htaccess file was causing the issue. Generate a fresh .htaccess file from your WordPress admin area and go to Settings > Permalinks page. Click on “Save Changes” at the bottom of the page and WordPress will generate a new .htaccess file.
Removing 403 Forbidden Error Caused By Empty Website Directory
Your website content should be uploaded in the correct directory.
Plesk server: /var/www/vhosts/example.com/httpdocs/
When you connect with your FTP client, navigate to the httpdocs directory and replace example.com with the actual domain name.
Removing 403 Forbidden Error Caused By No Index Page
The homepage of your WordPress website is called index.php or index.html. If the 403 Forbidden Error is being caused by no index page then you can resolve it by uploading an index page to your httpdocs or public_html directory. In case your home page is called something else like home.html, then you can rename your home page to index.html or index.php.
Conclusion
With the help of the information present in this article, you can easily identify what is causing a 403 Forbidden Error on your WordPress site and how to resolve it. We hope you found this helpful and informative.