403 Forbidden error is one of the errors that you might have come across when you are using WordPress. This is the complete in-depth article about how you can fix 403 forbidden error in WordPress with ease.
We will start with the overview of why this error occurs and later on, we will move on to the ways to fix it.
Why Forbidden Error Occurs?
Forbidden (as the name says) simply means that you are not allowed to access this content. This usually means access to denied.
There are two main ways this error is shown.
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.
Either way, you can fix it easily.
Now, there are many instances of how the error occurs. The entire website needs to be working. In most cases, only the home page will not be working.
It means that if you try to open the admin URL, it will work like a charm and you will see the admin panel. So, it is first recommended that you check out the admin URL (wp-admin) to see if it is working or not.
If the admin panel is working properly, you will fix it easily.
We will see the ways to fix error 403 forbidden from the admin panel as well as directly from the hosting panel. So, take your hosting panel details, and let’s solve the error.
Fix Error 403 Forbidden in WordPress
Before we get into the steps to fix the error 403, here is the most important thing you need to do.
Create a Backup
Here, we will make many changes in the hosting panel as well as in the WordPress panel. Some of them might even cause some problems.
Therefore, it is recommended that you first create a proper backup of your files and database. You can either do it with the plugin if the admin panel is accessible.
However, if the admin panel is not accessible, you can surely do it from the file manager itself. Just create a zip file and keep it there. In the same way, export the database too.
Once you have your backup, you can continue to the steps. You can start trying the below-given techniques one by one. You will surely solve the error.
.htaccess File Corruption
The first reason for this error is the .htaccess file corruption. If the file is corrupted, you won’t be able to access the website. Instead of seeing the content, you will see the error.
Therefore, we will try to fix this issue at first. If this doesn’t work, we will move on to the next.
If your admin panel is accessible, you can fix it in no time. Just open your WordPress dashboard and hover to the settings menu. Click the permalinks from the sub-menu and you will see the link structure. Don’t do anything, just click on the Save button. This will regenerate the .htaccess file. Now, try to check the website if it is working or not.
In the same way, if you don’t have access to the WordPress panel, you can do it from the file manager. Open the WordPress directory in the file manager. Download .htaccess file. If you are not able to find it, you can click on settings on the top and click on “show hidden files”. Now, download the file for backup.
Your next step will be to delete the .htaccess file from the server. Now, reload the page to see if it fixes the error. Don’t worry, the file will be regenerated when you open the page. If not, you surely have the backup that we took.
The Plugin Issue
Commonly, one of the WordPress plugins might have misbehaved. Due to which the entire issue is caused.
At first, try to deactivate the plugin that you recently installed. You can go to Plugins > All plugins and deactivate the one that you have recently installed. If the issue doesn’t get fixed, you can deactivate all the plugins. Try refreshing the page, if it works, you can activate all of them again.
If the issue occurs again after activating the plugin, you will have to troubleshoot things yourself. Try to figure out which plugin is causing the error by deactivating a set of plugins and trying to refresh it again.
Now, if you don’t have access to the WordPress panel, you can head over to the file manager. Go to your WordPress directory and open wp-content from there. Head over to plugins and change the name of the plugin that you recently installed. You can simply add 1 at behind. This will deactivate that particular plugin. Try to refresh the page.
If it doesn’t work, you can change the name of the plugins folder. This will deactivate all the plugins directly. You can try to refresh it again to see if the issue is solved or not.
You can surely try to update the plugins. Sometimes, the plugin’s bugs would have been solved in the next update. Therefore, you can try to check for updates and download them. You can also download the update and replace it with the file manager.
The same goes for the theme.
In most cases, this will be solved. However, if you still see the error then you can check the file permission to fix the 403 forbidden error in WordPress.
Fix File Permission
The next thing to focus on is the file permission. Every file and folder has specific permissions assigned to them. Depending on the permission, you or the user will be able to access the file or the folder.
There are specific permissions that you will require to access the files.
If for some reason the folder and file’s permission has been reset, you will see the forbidden error. Don’t worry, it is an easy task. We will see the exact steps to do it.
Go to the file manager and head over to your WordPress installation. Now, your next task is to see the wp-admin folder. Right-click on it and select file permission from the drop-down. Make sure the numerical value is 744 or 755. If it is not so, you can click OK and that’s it.
You can try refreshing the page again to see if it works or not.
In the same way, you can also check the file permission. The file permissions should be 644 or 640. You don’t need to check all the files, just check the main files of your WordPress installation.
Now, you surely might be thinking that it is a hard task to check all the folders and files, right? You can try contacting the hosting provider. Some of the hosting providers are good enough to fix the file permissions for you. So, it is always good to contact the hosting provider. With that being said, we are in the last way to do it.
Contact the Hosting Provider
If none of the above methods works, there are no other ways to do it. You can try contacting the hosting provider in this case. The hosting provider will tell you what’s the issue and why you are seeing this error.
Sometimes, this is also from their side. So, if the problem is from their side, they can tell you how to fix it. You can simply contact the live support to see if the issue is from their side.
If it is not, you can ask them to check your account and see what’s the problem. The hosting provider will surely tell you what’s the problem and in most cases, they will also fix it for you.
Before you contact your support, make sure you check all your websites to see if the issue is for all the websites or not. This will help the support team in a better way. You will also need the support pin in some of the hosting providers. Make sure you keep it handy when you are contacting the support. They will ask for it before they fix it for you.
In this way, you can solve the issue without any issues. If your hosting provider doesn’t have a live chat option, you can open the support ticket and get a solution to this issue.
To conclude, this was all about how to fix the 403 forbidden error in WordPress. The plugin part or the .htaccess file part will solve the issue in most of the cases. However, if it doesn’t solve it for you, you can surely move on to the file permission method to solve it. If nothing works, the support team is there for you to help whenever you need it. That’s the reason why we always suggest you go with the best hosting who has awesome support. If the support is good, they will even fix the permissions for you without you having to do anything.