Why doesn’t Site Health show less disk space after a cleanup?

WordPress doesn’t measure folder sizes live. Tools → Site Health → Info → Directories and Sizes shows sizes that were saved earlier (the dirsize_cache transient), and that saved copy is meant to last for years. WordPress only refreshes it when you upload a file, not when files are deleted. So after a cleanup, Site Health keeps showing the sizes from before.

cPanel reads the server’s disk directly, so it’s the number to trust. If cPanel shows that space was freed, the files are gone.

To refresh Site Health, delete the saved sizes, then reload the page:

  • WP-CLI: wp transient delete dirsize_cache
  • Or a plugin such as Database Cleaner: find and delete dirsize_cache.

Uploading any file to the Media Library also refreshes the uploads and WordPress folder sizes.

On very large sites, Site Health may run out of time while recalculating and show “Loading…” or nothing. That’s a WordPress limit, not a cleanup problem.

Developers

Optimize Thumbnails

When you upload a media file to your WordPress site, it automatically generates a set of thumbnails (smaller versions of the original image). These are used on your website to serve the most appropriate image size dynamically, helping your site load faster by adapting to each visitor’s screen size, connection speed, and other factors.

WordPress determines which thumbnail sizes to create based on a list defined by your theme, builder, or other plugins.

If you’ve changed themes or builders over time, you probably have old thumbnail sizes that are no longer needed. That’s when you can use the “Optimize Thumbnails” scan, it identifies and helps you remove these unnecessary thumbnails to keep your media library clean and efficient.

Process

┌──────────────────────────────────────────────┐
│         🔍 OPTIMIZE THUMBNAILS SCAN          │
└──────────────────────────────────────────────┘
                │
                ▼
      1. Get the list of sizes
         currently declared on your site
                │
                ▼
      2. Go through all media files
         in your library
                │
                ▼
      3. Check existing thumbnails
                │
       ┌──────────────────────────────────────┐
       │              DECISION                │
       └──────────────────────────────────────┘
        ├── If thumbnail size is NOT declared → ⚠️ Flag as ISSUE
        ├── If thumbnail size is declared → ✅ Mark as ORIGINAL
        └── If declared size has NO thumbnail → ⚙️ Generate and mark as GENERATED

Result

The Issues tab lists all the thumbnails detected as not part of your current size list. Be careful — this doesn’t necessarily mean those images aren’t used somewhere on your site. It only indicates that WordPress no longer generates those sizes based on your current theme or plugins.

The References tab shows all the original (OG) and generated (GEN) thumbnails that were found or created during the scan process, giving you a clear overview of what’s valid and what was newly regenerated.

Clean the Sizes

As explained, Media Cleaner helps you remove files that shouldn’t have been generated with your current sizes, but it doesn’t actually change which sizes WordPress creates.

If you want to completely remove specific image sizes, you’ll need a specialized plugin to disable them entirely.

A great option is Perfect Images, it’s free and lets you easily see all the image sizes used on your website. You can simply check or uncheck the sizes you want to keep or remove, giving you full control over which thumbnails WordPress generates.

Can’t empty the trash

It’s possible that Media Cleaner refuses to clean certain media because they are either unsafe to delete or the physical files are already missing. In those cases, the plugin will display an error message and ask you to run a new scan, which is the recommended course of action.

If this issue persists and prevents you from emptying the trash, you can go to the Advanced Settings and use the Force Clean Trash option. This will identify all items in the trash that are returning errors and permanently remove them.

Before using this feature, make sure you have a backup.

Please note that this action is irreversible. The affected media will be permanently deleted and cannot be recovered afterward.

Manual Removal

You can check under your /uploads folder to see if there’s a trash folder containing the media.

If it’s missing, it’s likely that the files have already been deleted manually or by another process, meaning the space shown as being used by the trash is actually 0. This happens when your database isn’t up to date with the actual state of the folder.

To fix this, you can run the following SQL query in your database (always make a reliable backup first):

DELETE FROM wp_mclean_scan WHERE deleted = 1

Most database admin panels have a section where you can manually run SQL queries — simply paste this code there and execute it.

If you’re not sure where that is, your hosting provider can guide you.

If the trash folder still exists and contains files, you can manually delete it, then run the same SQL query to update the database afterwards.

Trash

When Media Cleaner runs a scan, it doesn’t change or delete any of your files. It simply detects media that may not be in use and shows them to you so you can review the results yourself. Think of it as a visual aid to help you decide what’s safe to remove.

By default, the results are ordered by file size, so the heaviest media appear first.

You can choose to click Delete All to move all detected items to the trash, or select them individually, page by page, using the checkbox in the table header. When you delete them, the files are moved to a Trash section (located in /uploads/trash). At this point, the files still exist on your server but are no longer referenced on your website. This gives you time to check your site for missing content and catch any false positives.

If something is missing after deletion, no worries — you can restore it. Go to the Trash section, select the file(s), and use the Recover option. This moves the file from the trash folder back to its original location, making it available on your site again.

If everything looks good and you have a full backup, you can empty the trash. Be aware that this permanently deletes the files — there’s no going back after that, which is why keeping a backup is mandatory.

Is 1 license only for 1 website?

When buying the PRO version you can see how many licenses you will get.

This refers to the number of active licenses you can have running at the same time. For example, if your license includes 5 activations, that means you can use it on 5 websites concurrently.

You can reassign the license to different domains as often as you like — so if you only need it active on one site at a time, you can have one single license and you can switch it between projects freely. Just keep in mind that you can’t use it simultaneously on more sites than your plan allows.

Note that for multisite setups, each sub-site is considered its own website, as the domains are different. You can use a single license, but don’t forget to change the domain each time.

Does it work with … ?

Media Cleaner works by checking your post content and searching for any media that may be referenced there. So if your media is explicitly referenced in your posts, it should work as expected.

Some third-party plugins reference media in their own way. In those cases, Media Cleaner requires a specific parser for that plugin.

You can check which plugins Media Cleaner has detected on your site by going to the Parsers tab in the plugin’s settings.

If you’re experiencing false positives, follow this documentation to troubleshoot the issue. On the other hand, if your plugin is not listed but you’re not having issues, it likely means the media references are explicit and no parser is needed. Not every plugin needs a parser.

You can simply try the free version first. On the dashboard, before running a scan, you’ll see a list of all parsers that would be used if you had the Pro version. You will also, in the Parsers tab of the settings, see them listed. This way, you’ll know ahead of time whether the Pro version would support your setup.

Will it be compatible with … ?

We are always looking to make Media Cleaner compatible with as many WordPress tools as possible.

If you are using a plugin that is widely know/used, feel free to reach out through our support, and we will do our best to create a parser for it. For custom or less-known plugins, you might want to contact the plugin developers directly and ask them to support Media Cleaner using our provided integration template.

You can check the false positives documentation, where we explain more about the parser creation process.

Frequently Asked Questions

Unused File Not Found

The plugin can occasionally show false positives—meaning it might think a media file is unused when it actually is—but the reverse isn’t possible. It cannot miss an unused file. Why? Because during the scan, the plugin initially marks all files and media as “unused”. Then, it goes through your posts, pages, and other content to search for references to these files. When it finds a match, it changes the status of that file to “in use.”

So if a file is truly unused, there’s no way for the plugin to overlook it, it simply wouldn’t get marked as used.

Note that if you’re using the Media Library scan, when just one thumbnail of a media file is found in use, the entire media item (including all of its thumbnails) will be marked as used. If you want a file-by-file result, make sure to use the Filesystem scan instead.

If you believe there are files you’re not using that aren’t appearing in the results, you can go to the “References” (Found In Use) section on the dashboard. This shows all the references where your media were detected and with what kind of reference ( ID or URL ).

Also, if you see a SAFE tag next to a media file, it means that no reference was explicitly found, but the file was marked as “in use” because of how WordPress (or a third-party plugin) might dynamically reference it. For example, WordPress might store only the media ID and then generate the full URL when the page loads. To avoid broken content in such cases, the plugin marks these files as SAFE—even though the reference wasn’t directly detected.

Clean Uploads Folder

This is only available if you are using the PRO version of Media Cleaner.

The Clean Uploads Folder scan will check the content used across your website and will return results where each entry represents a file from your /uploads folder.

There are two types of scans you can run. The one you likely want is the Content scan, which goes through all of your website content to identify the media used across your pages.

The Library Scan matches physical files against your WordPress Media Library entries. It does not check whether a file is used on your website. Instead, it verifies whether the physical file on your server is properly linked to a corresponding Media Library entry in WordPress.

You can enable both scan types at the same time, but keep in mind that the dashboard will list both results in the same table, so it’s usually better to run only one type of scan at a time.

However, if you disable both, the scan will list all of your files. You can then use filters if you want to get a list of specific files — for instance, to retrieve all of your “.webp” files in one go.

Filters

Those filters will be applied during the scan. 

Keep in mind that you can also search through the results of your scan using the search function in the Cleaner Dashboard. For example, you can type “/2020” in the search and results will be filtered by that directory. So you might not need those filters, they are for advanced users.

Before the filters are applied, the scan will need to go through all the directories and files first (one reason is that, even if you filter out a directory, some files or subdirectories might match positively your filters). Therefore, using filters will not make the scan faster.

Directories Filter and Files Filter can restrict the scanning to specific folders and/or files depending on a regular expression (expressed between two slashes). If you don’t know how to write a regular expression, it might be interesting for you to learn. There are many tutorials online, and then you can test them on websites such as Regex101. Here are a few examples:

  • Directories Filter: /^$/ (only scan the root of your /uploads directory)
  • Directories Filter: /^2018/ (scan only the files from 2018)
  • Directories Filter: /^[0-9]{4}\/02/ (scan only the files in the February directories)
  • Directories Filter: /^((?!wp-slimstat|woocommerce-pdf-invoices|wpo_wcpdf|arprice|mk_assets|fvm).)*$/ (avoid scanning specific directories)
  • Files Filter: /400×400.jpg/ (scan only the files of resolution 400×400)
  • Files Filter: /.jpg|.png/ (scan only the png and jpg files)

Thumbnails Only. Will only scan your thumbnails and avoid the original (full-size) images. This could also have been done with a regular expression but is to make life easier for most users. Have a look at the Recommended Procedures for the usual usage of this option.

Results

In the dashboard, make sure you have the “Clean Uploads Folder Scan” scan method selected and click the Scan button. You will see all the media that have not been found across your website. You’ll likely find many more “issues” than with the Media Library scan. As you can see here, when a media file is not used, all of its thumbnails are individually detected as not in use.