Disable directory browsing
Directory browsing allows anyone to see all the files in a folder and their contents. To help secure your site, you'll want to use your hosting's file manager to edit the files.
- You should always backup your site before making any changes.
- Navigate to the different folders of your website (ex. http://coolexample.com/wp-content) in your browser to see if a list of files is displayed instead of a web page.
- If you don't find any folders that are displaying file lists, there are no further steps for you to follow.
- Access the File Manager for your hosting plan. (Web Hosting / cPanel / Plesk)
- Navigate to the folder that displayed a directory listing.
- Edit the .htaccess (Linux) or web.config (Windows) file.
- Linux: at the top of the .htaccess file, insert the following line:
Options -Indexes
- Windows: in the web.config file, find and remove the following line:
<directoryBrowse>
- Linux: at the top of the .htaccess file, insert the following line:
- Save the changes to your file.
You have now disabled directory browsing. If you are still able to browse the directory in your browser, you will want to consider clearing your browser cache, trying another browser, or review the steps again for accuracy.
More info
- For more information about our premium support for WordPress, please visit our WordPress Premium Support Catalog.