How To Disable Directory Browsing in WordPress

By default, Apache web servers enables directory browsing. It means, whenever the web server is unable to find an index file ( index.php or index.html ), it automatically displays the list of files and folders within that directory.

Quick Tip: How to get the email address of the site admin

This can be used by hackers to find out if you have vulnerabilities in themes and plugins by sniffing through these files.

Disable directory browsing in WordPress

Disable directory browsing in WordPress

To disable directory browsing in WordPress all you need to do is add a single line of code at the end of your .htaccess file located inside your root directory.

Options -Indexes



Leave a Comment.