In this guide
What directory listing exposes
When a folder has no index.php or index.html, some servers show a list of everything inside it. On WordPress sites, that most often affects:
wp-content/uploads/, including private files you assumed nobody could find;- backup files left by plugins or migrations (
.zip,.sql,.tar.gz); - log files that may contain errors, paths or personal data;
- plugin folders, revealing exact versions you run.
Complete database backups are sometimes downloadable this way, which means every user’s email address and password hash.
How to check
Open https://yoursite.com/wp-content/uploads/ in a browser. If you see “Index of /wp-content/uploads” and a file list, it’s enabled. A blank page or a 403 Forbidden means it’s off.
How to disable it
Apache
Add to the .htaccess file in your site’s root:
Options -Indexes
Nginx
Directory listing is controlled by autoindex, which is off by default. If it’s on, ask your host to set autoindex off; for your site.
Your hosting control panel
cPanel and some other panels have an “Index Manager” or similar option to turn off listing per folder.
Then clean up what was exposed
- Look for backups, exports and logs in public folders, and move or delete them.
- If a database backup was publicly accessible, assume it was downloaded: change all WordPress passwords and the database password.
- Make sure your backup plugin stores backups outside the public web folder, or in off-site storage.
From my audit work: directory listing on its own is a small issue. What it reveals is often the big one. A forgotten backup-2024.zip or a .sql export in the uploads folder turns a “low” finding into a real breach. When I see listing enabled, I always check what’s actually in those folders.