WordPress Security ServicesMalware Removal
Scan Findings Explained

"Directory Listing Enabled" on WordPress: Why It Matters and How to Turn It Off

If visiting yoursite.com/wp-content/uploads/ shows a list of folders and files instead of an error, directory listing is enabled. It's an easy fix, and one of the scan findings that's worth fixing straight away, because it can expose more than you'd expect.

Sergey By Sergey, WordPress security specialist Updated 1 min read
In this guide
  1. What directory listing exposes
  2. How to check
  3. How to disable it
  4. Then clean up what was exposed

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

  1. Look for backups, exports and logs in public folders, and move or delete them.
  2. If a database backup was publicly accessible, assume it was downloaded: change all WordPress passwords and the database password.
  3. 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.

Sergey, WordPress Security Specialist
About the author
Sergey, WordPress Security Specialist

10 years in WordPress security and incident investigation, and more than 200 websites cleaned of malware. Top Rated on Upwork with a 100% Job Success score. More about me

Frequently Asked Questions

Is directory listing dangerous?

It doesn't let anyone change files, but it can reveal things you don't want public: backup files, database exports, logs, plugin versions, or private uploads. Those can lead to real attacks or data leaks.

Will disabling it break my site?

No. It only changes what happens when someone opens a folder that has no index file. Your pages, images and files keep working.

Do I still need the empty index.php files WordPress adds?

They're a fallback that prevents listing in WordPress's own folders. Keep them. Disabling listing at the server level covers everything else, including folders plugins create.

Need a hand?

Let me clean your WordPress site for you

Send me your site URL and what you're seeing. I'll reply with what I think is going on and the next step.

$95 per infected site · 1-month guarantee · direct contact with the specialist

Get My Site Cleaned →