Are you dealing with the 403 Forbidden error on your WordPress site?
It is one of the most annoying errors that a WordPress beginner can come across. It may stop you from accessing your WordPress admin area and/or specific pages on your website.
In this article, we will show you how to easily fix the 403 forbidden error in WordPress.
What Is the 403 Forbidden – Access Denied Error in WordPress?
WordPress shows codes and messages when an error occurs on your website. You can see our list of the most common WordPress errors and how to fix them for some examples.
The 403 Forbidden error code is shown when your 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.
There are different scenarios when you might see this error. For example:
- 403 Forbidden – Access denied on the wp-admin or WordPress login page.
- 403 Forbidden – During WordPress install.
- 403 Forbidden error – When visiting any page on your WordPress site.
You may also see ‘Access Denied’ instead of the full 403 Forbidden status. Alternatively, the message might say, ‘Access to yourdomain.com was denied. You don’t have authorization to view this page.’
Now that you know about the different types of 403 errors, let’s talk about their causes.
What Causes the 403 Forbidden Error in WordPress?
The most common cause for the 403 Forbidden error in WordPress is poorly-configured security plugins. 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 we use Sucuri to improve the security of all our WordPress sites.
Your WordPress hosting company can sometimes make accidental changes to their server settings. This may result in a 403 Forbidden error on your site.
Having said that, let’s take a look at how to fix the 403 forbidden error in WordPress.
If you’d prefer written instructions, then just continue reading.
Fixing the 403 Forbidden Error in WordPress
Before you do anything, we recommend that you create a complete WordPress backup of your website. You can check out our guide on how to backup your WordPress site.
If you are using an automatic WordPress backup plugin, then make sure that you have access to the latest backup before moving forward.
Fixing the 403 Forbidden Error Caused by a WordPress Plugin
The first thing you need to do is to temporarily deactivate all WordPress plugins. This includes any security plugins that you may have installed on your site.
If this resolves your 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 activating all your plugins one at a time until you reproduce the 403 forbidden error. Then, you will need to delete the problem plugin and look for an alternative or contact the developers for support.
Fixing the 403 Forbidden Error Caused by Corrupt .htaccess File
Often, the 403 error is caused by a corrupt .htaccess file in your WordPress site. The good news is that fixing this file is quite easy.
First, you need to connect to your website using an FTP client or the File Manager app in cPanel.
Next, find the .htaccess file in the root folder of your WordPress site. See this guide if you can’t find the .htaccess file in Your WordPress folder.
You will need to download the .htaccess file to your computer so that you have a fresh backup of it. After that, simply delete the file from your server.
Try accessing your website. If the 403 forbidden error is resolved, then this means that your .htaccess file was corrupt.
You can generate a fresh .htaccess file by logging in to your WordPress admin area and going to the Settings » Permalinks page.
Simply click on the ‘Save Changes’ button at the bottom of the page, and WordPress will generate a fresh .htaccess file.
Fixing the 403 Forbidden Error Caused by File Permissions in WordPress
If the other solutions have not fixed the 403 forbidden error on your site, then incorrect file permissions can be the most likely cause.
All files stored on your website have file permissions. These file permissions control who can access the files and folders on your WordPress website.
Incorrect file permissions can cause the 403 forbidden error. They make your web server thinks that you do not have permission to access those files.
You can ask your WordPress hosting provider to check your website for correct file permissions. Some hosts are very supportive, so they won’t mind and will probably fix that for you.
Changing file permissions yourself can have serious consequences. If you do not feel confident doing it yourself, then ask a friend for help or hire a professional.
However, if you want to do it yourself, then here is how to check your file permissions.
Simply connect to your WordPress site using an FTP client. Navigate to the root folder containing all your WordPress files.
Click to select a folder, right-click it, and then select ‘File permissions’ from the menu.
Your FTP client will show you a file permissions dialog box like this:
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 for the root folder to 744 or 755. You also need to check the box next to ‘Recurse into subdirectories’ and then check the option that says ‘apply to directories only’.
Simply click on the ‘OK’ button. Your FTP client will now start setting permissions for 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 the ‘Recurse into subdirectories’ and ‘apply to files only’ options.
Click on the ‘OK’ button, and your FTP client will start setting file permissions for all the selected files.
Try accessing your website now, and the 403 forbidden error should be gone.
We hope this article helped you fix the 403 forbidden error in WordPress. You may also want to see our expert tips and hacks to protect your WordPress admin area, along with our top picks for the best WordPress plugins to grow your site.