How to Fix 403 Forbidden Error in WordPress
Like many other WordPress issue this error is one of the common error occurs due to the faulty plugins, corrupted .htaccess file and incorrect file permissions. In this tutorial you will learn how to fix 403 forbidden error in WordPress easily.
Cause of 403 Forbidden Error
This error occurs when your server do not allow to access the page and the post in you blog. It can be because of the faulty plugins that adds incomplete script in your web server or your .htaccess file has corrupted. It also can be the incorrect file permission set in your web server
Troubleshoot 403 Forbidden Error
- Deactivate all the plugins.
- Delete .htaccess file.
- Set Correct File Permission.
Step-1: Deactivate all the Plugins
One of the cause of 403 forbidden error in WordPress is poorly coded plugins (especially security plugins) installed that may have blocks the IP address. It is necessary to deactivate all the installed plugins to determine which plugins is causing the issue.
Connect to your web server using FTP client such as FileZilla. Open root directory e.g. public_html then you will find wp-content folder. Double click on wp-content folder to open and look for the plugins folder where all your blog’s plugins are located. You have to rename the plugins folder to any name e.g. plugins.fix which will deactivate all the installed plugins in your website.
After deactivation, check whether your issue resolved. If you did not see 403 forbidden error then one of the plugins is causing the error. You need to activate plugins one by one to find out the faulty plugins.
Before activating the plugins you need to rename the plugins folder name e.g. plugin.fix to default name plugins.
Again, go back to root directory e.g. public_html then open wp-content folder where you will find plugins folder. Rename plugins.fix folder name to default name plugins. Now, open your WordPress dashboard and activate the plugins one by one.
You can refer to this guide on how to deactivate all the WordPress plugins for detailed instruction.
Step-2: Delete .htaccess File
Corrupted .htaccess file is also one of the possible causes of 403 forbidden error in WordPress blog. You can easily delete .htaccess file and regenerate.
Connect FTP client FileZilla to your web server. Open root directory e.g. public_html where you can find .htaccess file. Right click on .htaccess file and click on delete.
Once deleted check whether the issue is resolved, if you did not see the error then you can regenerate new .htaccess file from your WordPress dashboard. From WordPress admin panel click on Settings then Permalinks and clicking Save button. This will create new .htaccess file in your site.
Step-3: Set Correct File Permission
WordPress set file permission such as Read, Write, Execute for all the files and directories stored in your site. Setting up the file permission controls the access of files and folder in your site. If file permission for specific folder is incorrect then you will see 403 forbidden error.
Connect FileZilla to your web server then open root directory e.g. public_html. You will find wp-admin folder where you have to set particular file permission to operate.
You can see the file permission of folders or files opening wp-admin folder.
Go back to root directory e.g. public_html and right click on wp-admin folder then click on File permissions.
All folders in wp-admin should have file permission of 744 or 755 that allows the site owner to read, write and execute.
All files in wp-admin should have file permission of 644 or 640 that allows the site owner to read, write and execute.
WordPress set file permission to Read, Write, Execute for all the files stored in your site. Setting up the file permission controls the access of files and folder in your site. If file permission for specific folder is incorrect then you will see 403 forbidden error.
In numeric value type 744 or 755 then check Recurse into subdirectories and select apply to directories only. Now, click on ok button which will apply file permissions to all folders in your site.
Again, set permissions to files only. In numeric value type 644 or 640 then check Recurse into subdirectories and select apply to files only. Now, click on ok button which will apply file permissions to all files in your site.
Once the files and folders file permission are applied the 403 forbidden error will no longer display in your site.