3min Read

What is a 403 error and how to fix 403 Forbidden?

What is a 403 error and how to fix 403 Forbidden

A 403 error, also known as “403 Forbidden,” is an HTTP status code that indicates that the server understood the request but refuses to authorize it. In other words, the server has denied access to the requested resource.

It might interest you to know that this type of error is common with WordPress. There are several reasons why a server might return a 403 error:

  • Lack of permissions: The user attempting to access the resource does not have the necessary permissions to do so.
  • Authentication failure: The user has not provided the correct authentication credentials, such as a username and password.
  • IP blocking: The server is blocking the IP address of the user attempting to access the resource.
  • The requested resource is restricted: The server has restricted access to the requested resource, such as a web page or directory, due to security concerns or administrative policies.

Some other errors that occur and are related to error 403 are:

  • 400 Bad request
  • 401 unauthorized
  • 404 Not found
  • 408 Request Timeout

If you encounter a 403 error and would love to fix it, ensure that you have access to the website’s .htaccess mostly via the cPanel then follow the steps below to get the 403 Forbidden error message fixed.

1) Fix 403 forbidden caused due to WordPress plugins

Troubleshooting WordPress issues by deactivating plugins can be a good solution to the 403 error If you’re experiencing problems with your WordPress website, there may be an issue with one of your plugins. To find out which one is causing trouble, you can deactivate all plugins at once and reload the page. Here’s how you can do it:

  • Activate all plugins.
  • Deactivate each plugin one by one until you find the one causing the issue.
  • Alternatively, use phpMyAdmin to deactivate all plugins at once.

By following these steps, you can swiftly identify and resolve issues with your WordPress website’s plugins.

2) Fix 403 forbidden caused due to incorrect .htaccess file.

403 forbidden error can be caused due to incorrect .htaccess file or the user made some changes to the .htaccess file and due to this, the .htaccess file is corrupted and this may affect the website.

So to resolve this incorrect .htaccess file, you need to edit the .htaccess file in edit mode and replace the corrupted file with the original file.

Steps to change the .htaccess file:

1. You need to log in to your cPanel.

2. You need to scroll down to the files section and then click on File Manager.

3. Select the .htaccess file and open it in Edit mode. If you see any prompt, just click on the ok/edit so it can take you to edit mode.

4) Now you need to replace your .htaccess file content with the original .htaccess file content and then click on the “Save Changes” button at the top right corner. Find the .htaccess original code HERE. Copy the first Basic WP code and replace it with the one on your file manager .htaccess as seen below.

3) Fix 403 forbidden error caused due to wrong file permissions

If the above two solutions could not resolve the 403 forbidden error then the wrong file permission is most likely to cause the 403 forbidden error.

Also, keep in mind that the files stored on your website have file permission and this file permission allows those who can access the webpage to do so. All files and folders have different file permissions .

Note:

  • All files stored on your website have 644 file permission.
  • All folders that are stored on your website have 755 file permission.

If the file permissions are not correct then the web server does not allow the user to access the Webpage and they think that the user does not have permission to access the Webpage.

If the file permissions are not correct then change the file permission that is defined above.

After changing all file permissions of files and folders, then click on the “Ok” button to save the file permission.

For File Permission

Locate the file named “wp-activate.php” and right-click to open the options, then select “Change Permission” as seen below.

Click on the Change Permission and set them at 644 as seen below if they are set differently:

For Folder Permission

Locate the folder named “wp-includes” and right-click to open the options, then select “Change Permission” as seen below.

Finally set the permission to 775 if you see something different from that.

I believe this article assisted you in fixing the 403 error. If after the whole settings, you still encounter a 403 error, you should contact the website administrator or technical support for assistance.


The Author