How to Stop Directory Listing of Your WordPress Site
The directory listing makes it a lot easier to steal data and valuable information from your website that includes even the codings that you wrote to design your website. The directory listing list of all the files and folders of your website like a file manager app that anyone can download. Editing those files is not possible without going to admin panel, but you still risk your important files that any of the website owners will not want.
How to stop Directory Listing Via HTACCESS file
The .HTACESS file is used for many purposes, like Image Hotlink Protection, Redirection, Caching, and even managing Directory Listing. Follow these Step to Stop Directory Listing for your WordPress Blogs.
Step 1: Add a .HTACCESS Editor Plugin (Skip this step if you want to do it manually from Hosting’s Account and You know where to locate .HTACESS File)
- Go to Plugins –> Add Plugins option under your WordPress Admin Panel (Dashboard
- Look for “HTACCESS Editor” and install the following plugin
- Once Installed, Activate the Plugin.
Step 2: Edit HTACCESS file to Stop Directory LIsting
- Make sure you have HTACCESS Editor Plugin activated what we installed in Step 1.
- Now go to Settings under WordPress Dashboard and click on WP Htaccess Editor.
- You will be warned while keeping the Editing Option Disabled. You need to Accept the warning to edit the file.
- Now add the following line at the start or right after # Begin WordPress
- Save the changes and clear your website’s cache. That’s it and the directory listing is disabled for your site.