Latest Tech and Tips

How to Disable Directory Browsing in WordPress


By default when your internet server doesn’t discover an index file (i.e. a file like index.php or index.html), it robotically shows an index web page exhibiting the contents of the listing. This may make your web site weak to hack assaults by revealing necessary data wanted to exploit a vulnerability in a WordPress plugin, theme, or your server in normal. In this text, we’ll present you the way to disable listing looking in WordPress.

An example of directory index browsing in WordPress

Why You Need to Disable Directory Browsing in WordPress

Directory looking can be utilized by hackers to discover out when you have any information with identified vulnerabilities, to allow them to reap the benefits of these information to acquire entry. For the great safety of our websites, we use Sucuri for WordPress safety. They have a easy dashboard which permits us to do that and carry out many different WordPress safety strengthening steps with in few clicks.

Directory looking can be utilized by different folks to look into your information, copy photos, discover out your listing construction, and different data. This is why it’s extremely advisable that you just flip off listing indexing and looking.

Video Tutorial

Subscribe to WPBeginner

If you don’t just like the video or want extra directions, then proceed studying.

To disable listing looking in WordPress all you want to do is add a single line of code in your WordPress web site’s .htaccess file situated in the basis listing of your web site. To edit the .htaccess file you want to join to your web site utilizing an FTP consumer.

Once related to your web site, you will see that a .htaccess file in your web site’s root listing. .htaccess is a hidden file, and if you cannot discover it in your server, you want to just remember to have enabled your FTP consumer to present hidden information.

You can edit your .htaccess file by downloading it to your desktop and opening it in a textual content editor like Notepad. Now on the finish of your WordPress generated code in the .htaccess file merely add this line on the backside:

Options -Indexes

Now save your .htaccess file and add it again to your server utilizing your FTP consumer. That’s all you want to do. Directory looking is now disabled in your WordPress web site and folks attempting to find a listing index in your web site shall be redirected to WordPress 404 web page.

We hope this text helped you find out how to disable listing looking in WordPress to make your web site safer. For questions and suggestions you possibly can depart a remark beneath or be a part of us on Twitter.