Tutorial on how to fix 403 forbidden WordPress error

It must have happened to you that you enter one of the pages of your site or that you see an error called Error 403 when you open the content of the main page of your site, which contains a large phrase called forbidden in its content, which indicates that you have You do not have access to this page. This error is usually displayed in the following form on all sites, which you can see in the example below.

403 error in wordpress

Well, as you can see in the picture if your site has encountered this error, the following message will be displayed on your site, which will be created for the user due to the lack of access to the desired page from your host.

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 

The meaning of lack of access is that, as you know, in any type of server, just like a computer system, there is a series of access levels for people, that each user can view or edit a file depending on the level of access. Therefore, until you are at the read access level, the existing content will not be shown to you, and you will encounter a 403 error in WordPress. So, if you also encounter the WordPress 403 error, Hostfa’s knowledge base is with us.

How to fix WordPress 403 forbidden error

There are several ways to fix error 403 in WordPress, and below I will introduce each available way based on the most frequent occurrences. This error can usually occur in the following situations.

  • Lack of access to a wp-admin folder or wp-login.php file
  • An error during the installation of WordPress, which is mostly installing the easy package in WordPress, occurs
  • Seeing an error on a certain page of WordPress can be due to the use of a plugin or code
  • Lack of access to the domain
  • And…
Well, now that you are familiar with the different types of pages and the reasons that cause you to face the 403 error in WordPress, let’s move on to solving this problem. But be careful that:  

Before you do anything, make a full backup to fix it easily if you encounter another problem.

Fix WordPress 403 error when installing the plugin

One of the main reasons involved in the 403 WordPress error, which is repeated a lot, occurs after you install a plugin in WordPress, which causes a problem with the plugin due to interference in some site files. Will be. So, if your site encounters this error immediately after installing a plugin, you must first disable the desired plugin; if the error is not resolved, disable all WordPress plugins and then one by one. Check your site for each plugin you have activated so that if you encounter an error after activating a plugin, you will know which plugin is the problem.

Now that you have found the problematic plugin, it is enough to check the problem using existing methods such as checking the host log file, activating the debug in WordPress, etc. And after you find the reason, try to fix it. But if you do not know in this field, you can use an expert in this regard. Or finally, use a similar plugin to provide you with exactly the same functionality that the current plugin gives you.

Fix WordPress 403 error using htaccess file.

Another cause of a 403 error in WordPress is the htaccess file. Or not having access to one of the WordPress files (permissions), which acts as a key here. Therefore, to fix the error, log host and click on the File Manager option as shown in the image to enter the file management page in your host.

Add menu to WordPress theme

Now that you have entered the host file manager, go to Public_html and look for a file called htaccess. Look around. As its name suggests, this file is one of the hidden files, so you may not see it until you first enter the file management section.

View the htaccess file

So, similar to the image above, click on the setting option in the cPanel and activate the show hidden files option so that the hidden files will be shown to you. Now download the file and rename it to htaccess_old. Change it Now, after you have deleted or renamed the file, enter the WordPress dashboard and go to Settings > Single Links button once Save Changes to the htaccess file. Rebuild your host and solve your problem.

Fix WordPress 403 error by setting the access level of files and folders

The third reason that causes you to encounter error 403 in WordPress is the lack of access and permissions of files and folders related to WordPress. . And set the file that does not have the required access. For this purpose, according to the image below, log in to your host and select your file, then right-click on it and click on the change permissions option. According to the example, tick the relevant options based on the explanations for each file mentioned below. Please correct it.

Change the file access level in the host

As you can see, in the permissions section, numbers are displayed in three columns you should change this access level for WordPress files and folders so that the numbers are changed for you as follows.

  • The access level for all folders in WordPress is 744 or 755.
  • The access level for all files in WordPress is 640 or 644.

After checking and changing the access level for each WordPress file and folder, enter the WordPress folders and check the files in each folder and internal folders, and if the access was changed, correct them to solve the problem.

WordPress 403 error due to added htaccess file.

Sometimes it happens that for any reason, an htaccess file. It is added to the home folder located in the cPanel host. This file may have been added manually, or you transferring WordPress to another host may encounter this issue That’s why this htaccess file, which is located in the home folder and has caused a disturbance and 403 WordPress error. Which is inside this path from the file manager, delete it.

WordPress 403 error

using the above methods, fixing the 403 error in WordPress, you should know that this is due to the installation of SSL in WordPress. If you are using SSL in the cPanel host or direct admin and you have recently changed the host, you will encounter this error. To fix this issue, just ask your hosting company to reinstall the commercial SSL you are using on your new host to fix the 403 error in WordPress