The notorious 403 Forbidden Error is one of the most surprising and common errors a WordPress user can encounter. It can happen in any of the following situations: while logging into your site, editing or viewing pages and posts, and during WordPress installation or site migration.
It can be hard to worry about this error as it can be in a bunch of unrelated situations. At the same time, the error message is very brief in terms of information and is clearly “You do not have permission to access…”. Variations include: access denied, banned, access not allowed, not authorized to view, etc.
Here is an example of one of the many error variations.
Fortunately, troubleshooting is much easier than it might seem at first glance. In this tutorial, we will cover all the proven steps to fix the problem. We’ll start with the most common causes and solutions, but we’ll also cover some lesser-known cases of the 403 error.
How to Fix 403 Forbidden Error in WordPress
For starters, we highly recommend backing up your WordPress site. If you have any questions regarding this process, contact your hosting provider.
After backing up your data, you are ready to investigate possible causes and solutions for the 403 Forbidden Error.
Creating a New .htaccess File
The .htaccess file enables a number of server functions, but it can also be the source of the issues causing the 403 Forbidden Error. Fixing this file should fix the problem for the entire website.
However, due to the all-encompassing nature of the .htaccess file and its importance to the site, finding the problem can be quite difficult. To avoid the hassle of locating it, the easiest way to get rid of the problem is to erase valid .htaccess file and to create new one.
You can do this using an FTP client like FileZilla.
The .htaccess file is located in the root WordPress directory. However, it is usually hidden, so you need to enable the option(s) to show hidden files in the selected FTP client. For the purposes of this tutorial, we used FileZilla. In this FTP client, you will enable access to hidden files by going to the Server tab and clicking the “Force hidden files to show” option.
Be sure download Putting the .htaccess file in a location on your computer will allow you to store any previous editing work on the file, in case you determine that it is not the culprit of the 403 Forbidden Error.
Save the file using right click and download.
After saving the file, right click on and choose “erase”.
At this point, the 403 error should be gone if the culprit is a faulty .htaccess file. Login to your WordPress site and run the test.
If the problem persists, restore the backup .htaccess file saved on your computer. simply To upload the file to the directory it used to be.
If the error is gone, to create a new .htaccess file. Login to your WordPress site, Go to Settings > PermalinksClick it and click “Save changes” in the lower left corner.
Retest the error after creating the file. The way you test it depends on how the error occurs. You can refresh the post or page, re-login to your dashboard, view the page or post one more time, reinstall WordPress, re-access certain folders, etc. The same should be done after each suggested step.
If the error is still present, proceed to the next step.
Fix 403 Error Caused by Bad File Permissions
Another common cause of 403 Forbidden Error is having incorrect permissions on all files and folders that make up your WordPress site. Setting the permissions to the recommended values should fix the issue. You can do this manually by following the instructions below. Alternatively, you can ask your hosting provider to do this for you.
Using file permissions, the server determines which users are capable of reading, writing, or executing. More precisely, file permissions determine the ability to view, edit and run the file as a script. Folder permissions define whether you can view the contents of the folder, add or remove files inside, or perform actions on the entire folder.
Suggested permissions are:
To change folder permissions, to connect to your server using FTP client. navigate to the folder containing your website files, right click on and Click In the “File Attributes” option.
In the numeric value box, sting 755 or 750. Mark both “Return to subdirectories” and “Apply to directories only” checkboxes.
If you want to change file permissions, follow a similar line of action. Go to the folder with the files you need, right click he and choose “File Properties”. At that time, sting 644 or 640 in the numeric value box and Click In the “Return to subdirectories” and “Apply to directories only” checkboxes.
To change the permissions of the wp-config.php file, to find file in the root WordPress directory. In our case it is called public_html. right click on file and choose “File Permissions”.
In the numeric value box, sting 440 or 400.
Now verify If the 403 Forbidden Error is resolved.
Fix 403 Forbidden Error Caused by a WordPress Plugin
If the previous 2 methods did not resolve the error, most likely some of your WordPress plugins are to blame. Fortunately, testing this possibility is very easy.
Set course to Plugins > Installed Plugins and disable them one by one. Run a test every time you disable a plugin. If the bug is fixed, you will know that the problem was the last plugin you disabled. In that case, you can delete it and find another with the same/similar purpose, or contact plugin customer support for assistance.
Additional Troubleshooting Steps
In most cases, the 403 Forbidden error should be resolved using one of the 3 methods we described. But in rare cases, the error may require additional troubleshooting. Let’s look at these situations and possible solutions.
removing mod_security
Mod_security is an open source firewall used by some servers for security purposes. Sometimes, it can cause 403 Forbidden Error due to misconfiguration. This issue requires you to uninstall mod_security. You can do this yourself by following the steps we outlined below, or you can contact your hosting provider for assistance.
You can remove mod_security like this: adding the code below .htaccess file via FTP client.
<IfModule mod_security.c> SecFilterEngine Off SecFilterScanPOST Off </IfModule>
If the error is not resolved, delete the previously added code as it may cause security problems.
Reconfiguring Hotlink Protection
Hotlink Protection is an option in cPanel that prevents direct links to your files from other sites. These files are usually images, so the 403 error can manifest as the inability to view these images. Since this option is used to restrict access, an error is shown when you cannot access a file (image) that should be accessible.
To solve this problem, (re)construct Your Hotlink Protection. sign in to cPanel using your credentials, Scroll down security department and Click About Hotlink Protection.
All that remains is to carefully set the parameters. This usually means: Adding more file extensions to the “Block direct access” box and checking the “Allow direct requests” checkbox. File extensions must be separated by commas. In the “URLs to allow access” section, check the list of sites and add the missing ones. These sites are “whitelisted” from the hotlink protection process.
Rename File
Uploading files to WordPress is an often overlooked case where the 403 Forbidden error (among others) can occur. To be more precise, this issue occurs when you upload files with improper filenames. Quite often, they contain an apostrophe.
To test this, change your name file manually Only letters (except international language symbols), numbers and hyphens should be used in the file name. To upload and check if the issue is resolved.
Contact Hosting
If you haven’t had a chance to resolve the error with the suggestions we’ve given you, contact your hosting provider and seek further assistance.
final thoughts
You are likely to regain access to your site, pages or resources using this tutorial. At the same time, you learned something new about this annoying problem.
Feel free to bookmark this 403 Forbidden Error troubleshooting guide! It will definitely come in handy when you encounter a similar issue.
Support our work ❤️
If you enjoyed this article, consider leaving a tip to help us keep publishing great content.


























