The 403 forbidden error is one of the most dreadful errors that a WordPress beginner can come across. Not just that it turns off visitors, some SEO experts have argued that this kind of error also has some effects on site rank. In this article, we will show you how to easily fix the 403 forbidden error in a WordPress website.
You will also want to read:
Automatic Update in WordPress
Changing your WordPress website location
Configuring the basic settings in your WordPress website
How to Backup Your WordPress Website Automaticaly Using Backup Plugins
How to Fix a Hacked WordPress Website
What is a 403 Forbidden - Access Denied Error
WordPress displays different messages when an error occurs on a website.
The 403 Forbidden error code is shown when a server permissions don't allow access to a specific page.
This is why the error is usually accompanied by the text: 403 Forbidden - You don't have permission to access on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
Also read:
How to Install and Setup Your Premium WordPress Theme
How to Keep Your WordPress Website Updated
7 Security Tips for a WordPress Website
How to Optimize and Speed Up Your WordPress Website
How to Secure a WordPress Website
There are different situations when you can see this error. For example:
403 Forbidden - Access denied on wp-admin or WordPress login page.
403 Forbidden - during WordPress install.
403 Forbidden error when visiting any page on your WordPress site.
It is also possible that you only get to see Access Denied instead of full 403 Forbidden status..
You may also see Access to yourdomain.com was denied. You don't have authorization to view this page.
Those are the different type of 403 errors, Now, we can look at what causes this error.
What Causes 403 Forbidden Error in WordPress?
WordPress, the most common cause of the 403 Forbidden error is poorly configured security plugin. Many WordPress security plugins can block an IP address (or a whole range of IP addresses) if they believe them to be malicious.
This is why Sucuri is recommended by us to improve security of all WordPress sites.
Another possible cause is a corrupt .htaccess file or incorrect file permissions on your server.
Again, this type of error can be experienced when you hosting company make accidental changes to their server settings..
Also read:
How to create a simple portfolio website with WordPress
How to create and manage a page in WordPress
How to safely disable the WordPress automatic update feature
How to update your WordPress installation
How to Solve 403 Forbidden Error in WordPress.
It is important to once more sound our usual warning: Before you do anything, we recommend that you create a full WordPress backup of your website.
If you were already using an automatic WordPress backup plugin, then make sure that you have access to a latest backup before you continue.
1. Fixing 403 Forbidden Error Caused by a WordPress Plugin
The first step will be to temporarily deactivate all WordPress plugins. This includes any security plugins that you may have installed on your site. If this resolves the problem, then this means one of the plugins on your website was causing this error.
You can figure out which plugin was causing the error by re-activating your plugins one at a time until you are able to identify the plugin responsible for the problem.
2. 403 Forbidden Error Caused by Corrupt .htaccess File
Sometimes, and most often, the 403 error is caused by a corrupt .htaccess file in your WordPress site. Repairing this file is quite easy.
First you need to connect to your website using a FTP client or file manager in cPanel.
Next, locate the .htaccess file in the root folder of your WordPress site. Remember that the .htaccess file is a system file so if you are accessing through the cPanel area, you need to check the "show hidden files" option.
If you are accessing through an FTP software, you need to download the .htaccess file to your computer so that you have a fresh backup of it. After that, you need to delete the file from your server.
Try accessing your website. If 403 forbidden error is resolved, then this means that your .htaccess file was corrupt and responsible for the problem.
You can generate a fresh .htaccess file by logging into your WordPress admin area and going to Settings > Permalinks > page.
Simply click on the Save Changes button at the bottom of the page and WordPress will generate a fresh .htaccess file.
Also read:
The Many Uses to Which You Can Put Your WordPress Website
What you should know about optimizing your WordPress website for speed
WordPress Search Engine Optimization Tutorial
3. How to Fix 403 Forbidden Error Caused by File Permissions
All files stored on your WordPress website have file permissions. These file permissions control who can access files and folders on your website.
Incorrect file permissions can cause 403 forbidden error. It makes your web server thinks that you do not have permission to access those files.
If the above two solutions do not solve the 403 forbidden error on your site, then incorrect file permissions can be the most likely cause.
You can contact your WordPress hosting provider to check your website for correct file permissions. Some hosts are very supportive, they wouldn't mind and will probably fix that for you. Some may not because WordPress is a third party application and they are not likely to give their support.
You can also do it yourself but you need to be sure of the permissions you set as it can affect the security of your website.
If you want to do it by yourself, simply connect to your WordPress site using an FTP client. Navigate to the root folder containing all your WordPress files.
Checking file permissions
Click to select a folder, right click and then select File Permissions from the menu.
Your FTP client will show you a file permissions dialog box:
Changing file permissions using FTP
All folders on your WordPress site should have a file permission of 744 or 755.
All files on your WordPress site should have a file permission of 644 or 640.
You can set the file permission to the root folder to 744 or 755. Check the box next to Recurse into subdirectories and then check the option that says apply to directories only.
Click on the OK button. Your FTP client will now start setting permissions to all subdirectories in that folder.
Once it is done, you need to repeat the process for all the files. This time you will use file permission of 644 or 640 and don't forget to select Recurse into subdirectories and apply to files only
Click on the OK button and your FTP client will start setting file permissions for all the selected files.
Once that is done, try accessing your website again, the 403 forbidden error should have been resolved.
Do let us have your comments and suggestions.