- How to Fix “403 Forbidden Error” in WordPress
- What is 403 Forbidden Error?
- What Causes the 403 Forbidden Error?
- What Are the Different Versions of 403 Forbidden Errors?
- Managed WordPress Hosting Starting From $10/Month
- How to Fix the 403 Forbidden WordPress Error (Easy Fixes)
- 1. Clear Your Browsing Cache
- 2. Rollback to a Running Version From Your Hosting Backup
- 3. Check .htaccess File
- 4. Check File Permissions
- 5. Deactivate All Plugins
- 6. HotLink Protection
- 7. Contact Your Hosting Support
- Frequently Asked Questions
- Q. Why am I getting 403 Forbidden on a website?
- Q. Is the 403 error the same as the access denied error in WordPress?
- Q. What is the main difference between 401 and 403 errors?
- Q. How can I prevent the 403 error from occurring?
- wp-includes/css/: No matching DirectoryIndex
- WordPress doesn’t start with installing WordPress with LEMP on Ubuntu 20.04
- Want to learn more? Join the DigitalOcean Community!
How to Fix “403 Forbidden Error” in WordPress
Updated on September 19, 2022
Was your online experience interrupted by an annoying 403 error? Don’t worry! You’ve landed on the right page, as this blog unravels everything about the 403 errors on WordPress sites.
A 403 forbidden error looks critical enough to cause panic. However, WordPress errors aren’t as scary as they might appear.
But, before I move ahead with the fixes, let’s learn a bit about this error and its causes, so you can understand the underlying causes and fix those ahead of time. Short on time? Jump right ahead to the fixes.
What is 403 Forbidden Error?
This HTTP status code appears when you try to access a forbidden resource. This error code indicates a permission error and is commonly caused due to indexing issues, badly coded plugins, an empty site directory, or ownership issues.
What Causes the 403 Forbidden Error?
A major reason why the 403 error appears on WordPress sites is the improper configuration that denies access to the requested resource.
Other reasons include:
- A corrupt .htaccess file.
- A poorly coded plugin.
- Incorrect file permissions.
What Are the Different Versions of 403 Forbidden Errors?
You may encounter 403 forbidden errors in different versions; some of these are:
- 403 Forbidden
- HTTP Error 403 – Forbidden
- Forbidden: You don’t have permission to access [directory] on this server
- 403 forbidden error was encountered while trying to use an ErrorDocument to handle the request.
- Error 403
Managed WordPress Hosting Starting From $10/Month
Forget all the hosting hassles with a reliable cloud hosting platform. Robust security + Performance boost.
How to Fix the 403 Forbidden WordPress Error (Easy Fixes)
The 403 error can be a bit tricky to resolve because the server doesn’t allow your browser to load the scripts. That said, there are several ways to resolve the 403 forbidden error on WordPress sites.
The below section shares the easy fixes, and I recommend following the fixes chronologically to detect and fix the error sooner.
Note: Before trying any troubleshooting method, it is highly recommended to back up your entire website. Because if something goes wrong while troubleshooting, it will help you recover your website without any hassle.
1. Clear Your Browsing Cache
Clearing your browser’s cache is the simplest solution to the 403 error, and a hard refresh is always recommended whenever you encounter a WordPress error.
The 403 error might simply be down to the browser cache. So, clearing your browser cache and cookies or visiting your website in incognito mode might fix your issue.
2. Rollback to a Running Version From Your Hosting Backup
If your hosting provider offers an application or server-level backup, you can revert the changes and roll back to the previous running version. Reverting to the last working version can help you bypass the 403 error.
For example, your website worked fine on August 31 but stopped on September 1. In that case, you can go back to the previous working version with a few clicks.
If you are a Cloudways user, rolling back to a previous version is incredibly simple. Follow the steps below:
- Log in to the Cloudways platform
- Select your application
- Go to Application Management >Backup and Restore
- Roll back to the previous version by selecting the date from the drop-down menu
- And that’s it. Following the steps above will help you roll back to previous versions on the Cloudways platforms in minutes.
3. Check .htaccess File
Another reason why a 403 forbidden WordPress error may occur is a corrupted .htaccess file. You can fix a bad .htaccess file in a few seconds with any FTP manager.
- First, log in to your server using an FTP client.
- Go to the .htaccess file located in the public_html
- Right-click on the .htaccess file and download the file to remain safe.
- Once you’ve downloaded the file, delete the .htaccess file.
- Now go to your browser and refresh your website to check if the 403 error has been resolved.
Note: Don’t forget to upload the .htaccess file you previously downloaded to your server.
If the issue is resolved by deleting the .htaccess file, it confirms that the error was due to a corrupted .htaccess file.
To generate a clean .htaccess file, follow these steps:
- Log in to your WordPress dashboard
- Go to Settings > Permalinks
- You’ll be redirected to the permalink settings page
- Click the Save Changes button at the bottom of the page to generate a new .htaccess file.
- Open your FTP client to verify if the .htaccess file has been regenerated.
If the error still persists, move to the next troubleshooting method outlined below:
4. Check File Permissions
Many files in WordPress require access permissions. And if those permissions are incorrect, the server will give a 403 permission denied error, indicating you don’t have the requested file.
- Connect to your WordPress website using an FTP client.
- Navigate to the root
- Right-click public_html and click the file permissions
- Ensure that the numeric value in the Permission box is set to 744 or 775
- Check the box next to ‘Recurse into subdirectories‘
- Check the option that says ‘Apply to directories only‘
- Click OK
- Repeat the same process for all the files
- Set the file permission to 644 or 640
- Don’t forget to select Recurse into subdirectories >Apply to files only
- Click OK
- Check again to see if the 403 forbidden WordPress error is resolved. If it still appears, then perform the next step, i.e., deactivating the plugins.
5. Deactivate All Plugins
Sometimes poorly coded plugins can cause a 403 forbidden error on WordPress sites. Therefore, we can deactivate all our plugins and check whether the issue is resolved or not.
To deactivate your plugins:
- You must again access your WordPress files using an FTP client like FileZilla.
- Go to public_html > wp-content
- Change the plugins folder name (I’ve changed it to plugins-old)
- Go back to your browser and refresh.
- If the website starts working fine, then the plugins were causing the error.
- Change your plugins-old folder name to plugins.
- Once you’ve changed the folder name, go to the WordPress Dashboard > Plugins > Installed Plugins.
- You will see that all plugins are deactivated by default.
- Activate each plugin and check if your website works after activation, and you’ll find the problematic plugin.
6. HotLink Protection
Hotlink protection prevents other websites from using your site images. You can use hotlink protection if you don’t want to allow Google Images, Pinterest, or any other site to display your images. Also, it helps you with site bandwidth and server resource consumption.
Sometimes, enabling hotlink protection on your CDN/hosting can trigger a 403 error if it is not set up properly. Therefore, it’s highly recommended to carefully configure it and then check the site’s status.
7. Contact Your Hosting Support
If you have performed all the above steps and are still seeing the 403 error, the last resort is to contact your hosting provider. Many managed hosting providers offer prompt help with these issues.
Cloudways has 24/7 live chat & ticket support assistance and offers cloud-based WordPress hosting starting from $10/month. So, with a host like Cloudways, you’re in good hands, even in the world of scary errors like 403.
I hope you found this guide helpful and were able to solve the “WordPress 403 error” via the shared fixes.
Have you figured out any other ways to get rid of this problem? Please share your solutions with us in the comments below for people facing similar issues.
Frequently Asked Questions
Q. Why am I getting 403 Forbidden on a website?
You may get a 403 forbidden error when you try to access a website or a resource that has been marked forbidden.
Q. Is the 403 error the same as the access denied error in WordPress?
Yes, the access denied error is another name for the 403 error.
Q. What is the main difference between 401 and 403 errors?
A 401 error occurs when someone provides no credentials or invalid credentials. In contrast, a WordPress 403 permission denied error appears when the client has correct credentials but is denied permission to perform a particular action on a resource.
Q. How can I prevent the 403 error from occurring?
You can prevent the 403 error by following the steps below:
- Cross-checking the .htaccess file
- Evaluating the plugin before installing it because a poorly coded plugin can also cause this error
- Checking the file permissions
wp-includes/css/: No matching DirectoryIndex
I’ve found this error on my error log:
AH01276: Cannot serve directory /home/u146-qaqzkymwfke2/www/artistoncue.com/public_html/wp-includes/css/: No matching DirectoryIndex (index.html,Index.html,index.shtml,index.php,Index.php,index.phtml,Index.phtml,index.htm,Index.htm,home.htm,Home.htm,default.htm,Default.htm,default.html,Default.html) found, and server-generated directory index forbidden by Options directive
I also get a dropdown field background changed to blue with a border everywhere(backend and frontend on my site). Not sure if it’s related to the above issue.
If you can please advise
The page I need help with: [log in to see the link]
This may be a plugin or theme conflict. Please attempt to disable all plugins, and use one of the default (Twenty*) themes. If the problem goes away, enable them one by one to identify the source of your troubles.
If you can install plugins, install and activate “Health Check”: https://wordpress.org/plugins/health-check/
It will add some additional feature under create a new menu position Tools > Site Health.
On its troubleshooting tab, you can Enable Troubleshooting Mode. This will disable all plugins, switch to a standard WordPress theme (if available), allow you to turn your plugins on and off and switch between themes, without affecting normal visitors to your site. This allows you to test for various compatibility issues.
There’s a more detailed description about how to use the Health Check plugin and its Troubleshooting Mode at https://make.wordpress.org/support/handbook/appendix/troubleshooting-using-the-health-check/
I also had a similar problem until I figure out it is not a problem… it is actually a good thing.
You might have in your .htaccess file the line below
Which protects folders on your server from being explored simply by using a browser as it was some FTP client. This way you protect the WP core files… as well as other folders on your server
The error log shows you every time that someone is trying to explore a path that he shouldn’t. So it’s not an error really…
It’s an error only if you actually want people to have access to the path mentioned in the error
- This reply was modified 2 years, 4 months ago by idccomm .
WordPress doesn’t start with installing WordPress with LEMP on Ubuntu 20.04
As I was following this tutorial https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-with-lemp-on-ubuntu-18-04, I came a long way. But then after step 5, WordPress doesnвЂ™t start on my website.
The website keeps displaying the html message that I programmed at step 4 of this tutorial https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-ubuntu-20-04, which I installed in this file: /var/www/your_domain/index.html
I have to say that the OS I am using is Ubuntu 20.04 (spec Ubuntu 20.04.1 LTS (GNU/Linux 5.4.0-45-generic x86_64)), but I donвЂ™t think that the problem is there.
My best guess is that the problem must have something to do with a redirection. Can anyone help me out here? There are also similar questions below the tutorial, but the answers proposed are not working for me.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
There are a couple of things which could be causing this problem.
- If you installed WordPress at /var/www/html/ , you would need to remove the index.html file from there, you can do that with the following command:
This needs to be done as WordPress uses an index.php file and that index.html is not part of the WordPress core files anyway.
- Make sure that the directory that youвЂ™ve installed WordPress in has the correct ownership:
Change the /var/www/ wordpress part if this is not the directory where you installed WordPress at.
- If none of the above helps, check your Nginx error log:
Let me know how it goes! Regards, Bobby
Want to learn more? Join the DigitalOcean Community!
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.