You did notice quite a lot of times that when your web server does not find your site’s index file, it will automatically showed up an index page displaying all the contents of the directory. Such conditions will nothing but open up a huge place for hackers, resulting in affecting the whole of your website in a single go. In this article, I will share with you the ways by which you can disable that directory browsing functionality for your WordPress website.

Steps To Follow

  • In order to disable directory browsing in WordPress, the first thing you need to do is to add a short snippet. This snippet will need to be added to your WordPress site’s .htaccess file which is located in your website’s root directory.
  • Remember that you will be requiring an FTP client in order to edit your WordPress site’s .htaccess file. Since .htaccess file is a hidden file; you need to make sure that you do enable your FTP client well in advance.
  • To edit, you need to download .htaccess file to your computer followed by opening it in a text editor. Once open, go at the end of your WordPress generated code and add the following line of snippet:

  • Save your site’s .htaccess file and upload it back to your website server with the help of FTP client, resulting in disabling the directory browsing on your WordPress website.