Did you get 403 Forbidden error on your WordPress website?
If you are a beginner in WordPress, then I am sure it might be scaring you. In this blog, you will get to know how to solve WordPress 403 forbidden error.
What does 403 forbidden error means?
It shows codes and messages whenever the error displays on your website.
There are different scenarios where you can get this error message i.e.
- When you are not allowed to access wp-admin or the login page of WordPress
- When you are installing WordPress
- When you are visiting any page in WordPress
There might be possibility that you just see ‘Access Denied’ rather than the full 403 error status. You can also get the denied statement as ‘Access to yourdomain.com was denied. You don’t have authorization to view this page.
Why 403 Forbidden Error Occurs
The most common cause is because of the poorly configured security plugins. As the security plugins can block IP addresses if they are malicious. Other causes can be the incorrect file permissions and corrupt .htaccess file.
Sometimes, the WordPress hosting company can change the server settings accidently. This will generate 403 forbidden access denied error.
How to Remove WordPress 403 Forbidden Error
Before proceeding, make sure you have backup of your website.
So, let us start.
- Fix the Error Due to WordPress Plugin
Temporarily, deactivate all the WordPress plugins. Make sure it includes the security plugins that might causing this error which you have installed on your website. If it solves the issue, then it means there is one of the plugin among all which causes this error.
Now, you can find out the plugin which was causing the error with activating the plugins one by one at a time until you get that error again. When you will find out, just grab that and deactivate it finally. This will solve your issue.
- Fix the Error Due to Corrupt .htaccess File
Mostly, the 403 forbidden error occurs due to the corrupted .htaccess file in your WordPress site. First, just connect to your website using a FTP client and navigate to the .htaccess file which is in the root folder of the WordPress. Take the backup and after that just delete the file from your server.
Now, try to access your website. If the 403 forbidden error get resolved, that means your .htaccess file was corrupt.
Now, you can generate newly .htaccess file with the help of your credentials of the admin area of WordPress.
Navigate to the settings > Permalinks page.
Here you can save the changes by clicking on Save Changes button at the bottom of the page and the fresh .htaccess file will get generated by WordPress.
- Fix the Error Due to File Permissions in WordPress
If the solutions I have mentioned above are not able to solve the 403 forbidden error then most probably it is due to the file permissions. The file permissions controls the access of folders and files on your website. If the file permissions are wrong, then it can cause the WordPress error 403. It can compel the web server to think that you are not allowed to access those files. It is better to ask the hosting provider to check website permission rather than to get trapped by changing it yourself which can result in serious consequences.
Still if you want to do it by yourself then here is how you would check your file permissions. Connect to your site by FTP client, navigate to the root folder which contains all your WordPress files. Now right click on wp-admin and select file permission as shown in the image below:
The FTP client will display file permissions dialog box like this:
The folders should have 744 or 755 file permissions and the files must have 644 or 640 file permissions. Here, you can set all the file permissions. Check the box which is next to Recurse into subdirectories and choose the option apply to files only after that click on OK button. Now, the FTP client starts setting the permissions for all the selected files.
After that try to access your website, the 403 forbidden error must gone now.
So, now you can solve the 403 forbidden error in WordPress easily. I hope this blog helped you in getting all of your answers.