How to fix the 403 Forbidden Error in WordPress

PublishedPosted on
Categories
How to fix the 403 Forbidden Error in WordPress

I have brought you another article in the WordPress help series. And it is about How to fix the 403 Forbidden error in WordPress. I have simple fixes for the issue. Before moving to the article, let’s have a look at the basics of this error.

What is this Error?

How to fix the 403 Forbidden Error in WordPress

WordPress displays various codes and messages when there is an error in your website. You can see this list of most common WordPress errors to get an idea about them.

Usually, the 403 Forbidden Error code is displayed when your server permissions won’t allow you to enter a specific page. And the error message will be like this.

403 Forbidden – You don’t have permission to access ‘/’ on this server.

Following are some examples of such instances in which you will be shown the error message.

  • 403 Forbidden – Access denied on wp-admin or WordPress login page, during WordPress install and when visiting any page on your WordPress site.
  • you might only see ‘Access Denied’ instead of full 403 Forbidden status.

What are the Causes ?

The most common underlying cause for the error is a poorly configured security plugin. Such plugins can block an IP address if they think they are malicious. Here’s where Sucuri comes to play. It can improve the security of all WordPress sites.

Other underlying causes might be a corrupted .htacess file or incorrect file permissions on your server. Your WordPress hosting company may accidentally make changes to their server settings causing the 403 Forbidden Error. Now let’s have a look at the detailed guide.

How to fix 403 Forbidden Error in WordPress

Before proceeding with the instructions I recommend you create a complete backup of your WordPress website. You can do it manually or with the help of an automatic WordPress backup plugin. Don’t forget to access the latest backup plugin before moving forward.

1. Fixing 403 Forbidden Error Caused by a WordPress Plugin

Initially, you have to temporarily deactivate all WordPress plugins including security plugins. If the issue disappears when doing so, the culprit is one of the plugins on your website. You can identify the plugin by activating them one by one till the error is reproduced.

2. Fix 403 Forbidden Error Caused by Corrupt .htaccess file

A corrupt .htaccess file is another common issue for the 403 Forbidden Error. You can repair this file easily.

  • First connect to your website via a FTP client or file manager in cPanel.
  • Then locate the .htaccess file in the root folder and download the file.
  • Now delete the .htaccess file from the server.
fix the 403 Forbidden Error in WordPress
How to fix the 403 Forbidden Error in WordPress
  • After that access your website. If yhe error is gone, you had a corrupt .htaccess file.
  • Navigate like this to create a fresh .htaccess file.
  • Login to WordPress admin area > Settings > Permalinks page.
fix the 403 Forbidden Error in WordPress
How to fix the 403 Forbidden Error in WordPress
  • And click on Save Changes button at the end of the page to create a new .htaccess file.

3. Fix 403 Forbidden Error Caused by File Permissions in WordPress

The files that are stored on your website have file permissions by which WordPress controls who can access which files. On the other hand, incorrect file permissions can result in a 403 Forbidden Error. This might be the underlying cause if the above two fixes are unable to solve the issue.

So you can ask your hosting provider to check the file permissions on your website.  Some hosts might even fix them. As changing the file permissions can lead to grave issues, I recommend you seek help from a professional if you are not confident enough. If you are confident you can try to fix the error using the following instructions.

  1. First connect to your WordPress site via FTP client.
  2. Then go to the root folder which contains all the WordPress files.
  3. Now click to select a folder, right click and then choose File Permissions from the menu. You will see a dialog box as in this picture.
fix the 403 Forbidden Error in WordPress
How to fix the 403 Forbidden Error in WordPress
  1. The file permissions should be like this.
  • Folders on your WordPress site – file permissions of 744 or 755
  • Files on your WordPress site –  file permissions of 644 or 640.

To set the file permissions to the root folder to 744 or 755, just check the box beside ‘Recurse into subdirectories and then check the option ‘Apply to directories only. Then click OK. So that the FTP client will set the permissions to all subdirectories in that particular folder.

Now all you have to do is to repeat the process with the rest. Use the file permission of 640 or 644 and select ‘Recurse into subdirectories’ and ‘apply to files only’ options. Finally, click OK. And access your website to see the error is still there.  



About The Author