How To Disable Directory Browsing In WordPress

Disable Directory Browsing

Directory browsing is enabled by default in most of the webservers. Due to this people can view the contents of the individual folder on your website. This can make your site vulnerable to hackers and your information may be revealed. 

To stay safe, one should disable directory browsing. If you don’t know how to do it, this post is for you. 

Let’s start.

Why Disable Directory Browsing

In your WordPress site folders, there are sensitive data that should be safe. E.g. wp-content, wp-include, etc. If a person from outside can access this folder, they can alter the code and your site may get hacked. Your valuable information may get leaked. 

Therefore, to stay safe directory browsing should be disabled. 

How To Disable Directory Browsing

First, you need to connect to your website using any FTP client. If you don’t know how to configure and connect your site with an FTP, you can check out this guide “How to use FTP to upload files on WordPress”. 

When you have successfully connected your website with FTP, find the .htaccess file. You will find this file on your website’s root directory. .htaccess is a hidden file, if you cannot find it make sure you have enabled your FTP client to show hidden files. 

Open the .htaccess file and add this line at the bottom. 

Options -Indexes

Save your file. If you cannot edit the file online, then download it and then edit it. Afterward, upload it to your website. 

Last Words

That’s all you have to do for disabling directory browsing on your website. If this post, helped you to disable directory browsing, please share it with your friends. Don’t forget to leave your thoughts in the comment box below. 

Leave a Comment

Your email address will not be published.