While accessing your WordPress website, you see a 403 forbidden error, which may frustrate you so I have written a detailed article to let you know, what is 403 forbidden error and how to fix it.
This will help you in restoring your Website’s functionality as soon as possible.
Without going into further introductory details, let’s explore:
- What is the 403 Forbidden error?
- How to fix the 403 Forbidden error
What is the 403 Forbidden Error?
There are many usual WordPress errors, the 403 Forbidden error is an HTTP status code
through which, a web server communicates with our web server.
A quick recap on HTTP status codes — whenever a browser connects with your website, the web server responds through an HTTP header. This all happens in the backend.
However, if there is something wrong, the server will respond with a different HTTP status code error. You may be frustrated with the numbering of the error, but these numbers help you to know exactly about the error of your website.
The meaning of the 403 forbidden error is that the web server is understanding the request of the client, but the server will not fulfill it due to some reason.
The working mechanism of WordPress represents codes and (text/graphical) messages in terms of any error.
The 403 error comes on the screen when a server permission rule doesn’t authorize access to a particular page. This error comes up with this text:
You can see 403 errors with different scenarios such as:
- Access denied on wp-admin or WordPress login page.
- During WordPress Install.
- Error while visiting any web page on your WordPress site.
- It might be possible that you only see “Access Denied” instead of the full 403 Forbidden code.
- Another option is that you receive “Access to your domain gen.xyz.com was denied” or “You are not authorized to view this page.”
We have described different kinds of 403 errors. Now let’s introduce different causes of this error.
Causes of 403 Error:
- The installation of unverified or badly designed security plugins is mostly a usual cause of the 403 error in WordPress. These bad plugins can block a single or complete range of IP addresses because of their poor configurations.
- If the .htaccess file is corrupt so it can also be a cause of the 403 error.
- If a hosting company has updated its server software settings accidentally so it can resist the normal working of a website and shows a 403 error.
- Hotlink Protection.
- File Permissions.
Let’s talk about the solutions to solve the 403 forbidden errors in WordPress.
Methods to fix 403 error:
Before starting to fix any errors you should create a complete backup of your WordPress website.
You can use the latest WordPress backup plugin and save your complete work. After that, you can follow these points:
1. Fixing through a WordPress Plugin:
First of all, deactivate your entire WordPress Plugins temporarily. Then check the status of your error if your error fixes so it means that the error was coming because of any plugin.
Now reactivate all plugins one by one while checking the 403 error and this is how you can find out the main cause of the error.
2. Fix Error through Corrupt .htaccess File:
Mostly, the cause of the 403 error is corrupt .htaccess which is placed on the WordPress website. Editing in the .htaccess file is not difficult.
First of all, you have to access the FTP client or file manager in the c-panel. Then go into the root folder of your WordPress website and locate the .htaccess file.
You have to download the .htaccess file to your system and save this file as a fresh backup of your .htaccess file. Then delete the file from your server.
Now try to access your website and check whether the 403 error is solved or not. If not fixed, then it means that the .htaccess file was corrupted.
After that, you can create a new .htaccess file from the WordPress admin, then go to Settings and create a .htaccess file from Permalinks.
After that just click on the Save Changes button which is at the left bottom of the page and WordPress will generate a new .htaccess file for that website.
3. Fix Errors through File Permissions in WordPress:
Every file on the website has its file permission. This permission process allows and disallows its users. But incorrect file permissions can cause 403 error which can create a barrier in front of one or more users
If the 403 error does not solve from the above two methods then you can solve the error through incorrect file permissions.
You can talk to your WordPress hosting provider to optimize and check your website for the right file permissions.
Few hosting providers are very helpful, they will likely fix that for you otherwise you can hire a professional individual to avoid any damages and get an instant solution.
Deactivate CDN Temporarily
In this case, you have to temporarily disable your CDN, and then check your website to see whether it is working.
Check whether Hotlink Protection Is Misconfigured
Hotlinking means that you add images to your website, but the hosted link is provided to any other website. To prevent this, you will provide a setup which is called “Hotlink Protection” with their WordPress hosting or CDN provider.
If hotlink protection is on, it will return a 403 forbidden error. In some situations, this is normal. But if you see an error on something else which you should not be, then you have to make sure that hotlink protection is configured properly.
Using an FTP client:
But you can also do it by yourself. You just have to connect to your WordPress website by using an FTP client. Find out the root folder containing all your WordPress files.
Click for folder selection, press right-click, and then select File Permissions from the menu. FTP client will show a file permissions dialog box such as:
- All folders should have a file permission of 744 or 755 of the WordPress website.
- All files should have a file permission of 644 or 640 of the WordPress website.
- Root folder file permission to 744 or 755. Check the next box “Recurse into subdirectories” and then check the option that says “Apply to directories only”
- Press “OK” Now your FTP client will start setting permissions to all its subdirectories in that folder.
- After that repeat, this process for all files and now use file permission of 644 or 640 and remember to select “Recurse into subdirectories” and “apply to files only” options.
- Press the OK button and now your FTP client will set file permissions for all the targeted files.
- Now it is time to check and verify the website that there is no 403 forbidden error.
The 403 Forbidden error means that there is no problem on the server side working, but due to some problem, you do not have permission to view some or all of your site’s content.
The most likely causes of this forbidden error are the issues with your file permission or the .htaccess file. Apart from that, there might be plugin issues, CDN issues, or hotlink protection issues.
This is a very useful article and we hope that this guide will help you to fix the error 403 in WordPress. You can also contact us to get one-to-one professional tips.