Are you getting a message on your WordPress web page stating “you are not authorized to access this page” while logging into your WordPress website? Don’t panic, you have done nothing wrong. This message appears due to an error called 403 forbidden error.
It is one of the most frequently appearing errors like Error page 404, Internal server error e.t.c. in WP websites and raises when the file permissions are specified incorrectly. In this article, you will learn about the 403 error, reasons why it occurs and the solutions to solve this problem.
How to Fix 403 Forbidden Error in WordPress
Just like other WordPress errors, 403 forbidden error is an HTTP status code appears on your screen when you don’t have required file permissions to access a page or site. Many people feel very hard to solve this error. They spend much time on tutorials and article about the error 403.
Here we show you the best ways to solve your forbidden error. We give you possible causes and solving procedures for WordPress 403 forbidden error.
Why WordPress 403 Forbidden Error occurs
Every file and folder will have an access permission number. If these gets violated, then HTTP 403 error appears. This error arises when the web server receives your request but fails to give a response to your request.
This error will also occur due to minor damages during installation of WordPress. In some situations, poorly coded security plugins can also be a reason for the 403 forbidden error.
Causes for 403 Forbidden Error
Incorrect File Permissions
All the files in WordPress have a specific type of file permissions. If these are set incorrect, then an error occurs. If you try to write the file which has read-only permission, can also cause 403 forbidden error.
Incorrect Home Page Files
If your homepage file or index.html file is incorrect then, it will rise an error 403. Sometimes, index.html file may miss or damaged or incorrectly defined. In these cases also, the error encounters.
In some cases, the WordPress files may be damaged. These files need to be replaced with new ones. During this process, you may place the files in one folder instead of the other. Also, make sure that all your WordPress files are put in httpdocs directory. If this directory is empty then, this will arise a problem 403 forbidden error.
When you are moving WordPress site from one directory to the other, then there is a chance of rising 403 error page.
Accessing hidden files
Under server configuration, some files are prohibited from viewing. If you try to access these files or hidden files then, it leads you to the error page.
Sudden changes in server
The 403 error occurs due to the sudden changes made to the server by the hosting company. Also if the server mod_security disabled, WordPress forbidden error rises.
Security plugins are responsible for defending malware. During this process, they block the login area if anything found suspicious. This will also encounter an error page 403.
When you write a post, we frame the permalinks. Even though you frame it correctly, you will get 403error in WordPress. If you ask Why it happens? Probably you will get the answer in the solutions for Forbidden error 403 in WordPress.
Corrupted .htaccess files
One of the reasons for the raise of error 403 in WordPress is Corrupted ‘.htaccess’ files. It is the most common reason for causing this WP error.
Uploading files to host
Sometimes, we need to move all the WordPress files from your root directory to the host. When they are placed in the host, access to those files will be lost leading you to the 403 error page.
Updating general settings
Making changes in settings sometimes arise an error 403. This is a very rare case which raises an error page.
Possible solutions to get rid of 403 Forbidden Error in WordPress
We hope you got a clear idea about the reasons causing 403 forbidden error. Once you knew the problem, you will start surfing to find an appropriate solution. To comfort you, we have provided a list of solutions here. From the list, you can select the required solution to solve the error 403.
Before going to mend the error page, it is a best practice to backup your WordPress website. This will save your data even when the website crashes due to changes made by you. It will be more secure if you use a good automatic backup plugin in your WP website.
Change Permission settings
Note: Before taking a step, Make sure you have enough knowledge about file permission. If you are not confident then, take someone’s help.
As we discussed above, the incorrect file permissions can raise an error. So to correct your file permissions, Log in to your website through FTP. Go to the root directory and search for wp-admin. Give a right-click on it and select file permissions. Set the file permissions correctly.
It is always a better practice to assign 755 to wp-admin.php folder and 644 to the wp-config.php and wp-login.php folders . Better avoid the 777 as it gives everyone the permission to access and modify your website.
Set the permissions carefully. This will solve your problem WP error403.
Remember : All the folders in WordPress website should have 755 or 744 file permissions. All the files must have 644 or 640 permissions.
Add index.php file
Sometimes when you open certain page or post then, you will get an error message as shown below.
You don’t have permission to access the requested directory. There is either no index document or the directory is read-protected. If you think this is a server error, please contact the webmaster.
To solve this, add /index.php/ to the beginning of the permalink. This will solve the Forbidden error 403 in WordPress.
Add code to .htaccess files
We all know that server provides security to your data or websites. While securing, it blocks access to your site if it suspects anything wrong. In this case, you have to intimate your server to unblock the website access. For that, you have to add the following code to your .htaccess file.
This will help you clear the error if it is due to the server.
Remove .htaccess files
The corrupted .htaccess files can cause many complications on your WP site. To solve this error, Login to your WP account through FTP. Go to file manager and search for WordPress root directory. There you will find .htaccess file. delete the file. This will help you to get out of the 403 error page.
After login, create a new .htaccess file as you deleted the existing one. To do this, go to setting option from your dashboard and click on permalinks. Don’t make any changes. Simply click on ‘save link’. This will generate a new .htaccess file for your WP website.
Set file permission to ‘000’
when you keep all your WP files in your host, the files cannot be executed. The problem will disappear if you disable your plugin directory and set the file permissions to “zero zero zero(000)”.
Disable security plugins
Poorly configures plugins are the most common error causing agents. To avoid WordPress 403 forbidden error, disable all the plugin that provide security. Now activate one-by-one to find which one is causing the error.
Delete the plugin which is caught in that process. This will solve the problem if the error 403 is due to the WP plugins.
403 error causes when the changes are done in general settings. So to get rid of this, Go to (WHM)Web Host Manager and select Apache configuration. In that, select Global configuration and tick the option FollowSymLinks. This will probably solve the 403 Forbidden error in your WordPress website.
If none of the above solutions worked for you then, the surely the problem is with your host. Consult your Host Management Team and seek their support to solve the 403 forbidden error. Keep following our website to more about WordPress errors and solutions to fix them. You can also learn about WordPress.