Why am I seeing this?
The “Maximum file count” error means your site has more unique files than ManageWP’s incremental backup system can track. The fix is to exclude non-essential folders from backup. Most sites resolve this in one or two exclusion passes.
Key Takeaways
- File count, not file size, is what triggers this error. A 10 GB folder with 50 files backs up fine; a 200 MB folder with 200,000 image thumbnails doesn’t.
- The fix is to exclude non-essential folders using the include/exclude content settings in Backups.
- Excluded files are removed from previous backups too, not just future ones. Move anything you might need to restore from before excluding.
What typically causes this?
The error is almost always traceable to one of these patterns:
- WooCommerce stores generating dozens of image variants per product
- Image optimization plugins that store cached variants alongside originals
- Old plugin or theme directories left behind after switching tools
- Log files accumulating in
wp-contentover months or years - Other backup plugins storing their output inside
wp-content
Knowing which of these applies to your site speeds up the fix. The diagnostic step below shows you which folders are the actual culprits.
How to fix this error?
Step 1: Find the folders inflating your file count
ManageWP’s Code Snippets tool runs PHP directly on your site and can return a folder-by-folder file count.
- From your ManageWP dashboard, open the affected website.
- In the left sidebar, click More Tools → Code Snippets.
- Paste this snippet:
<?php
function getFileCount($path) {
$size = 0;
$ignore = array('.', '..', 'cgi-bin', '.DS_Store');
$files = scandir($path);
foreach($files as $t) {
if(in_array($t, $ignore)) continue;
if (is_dir(rtrim($path, '/') . '/' . $t)) {
$size += getFileCount(rtrim($path, '/') . '/' . $t);
} else {
$size++;
}
}
return $size;
}
$path = ABSPATH.'wp-content/uploads';
foreach(scandir($path) as $p) {
$dir = $path.'/'.$p;
if ($p === '.' || $p === '..' || !is_dir($dir)) {
continue;
}
$count = getFileCount($dir);
echo "$p: $count\n";
}
- Click Run command.
The output lists each subfolder inside wp-content/uploads with its file count. Folders with disproportionately high numbers are your exclusion candidates. The script doesn’t check database tables, only files in the uploads directory.
Step 2: Exclude the heavy folders
Once you’ve identified the culprits:
- Open the affected website’s dashboard, then click Backups in the left sidebar.
- Click Settings → Include / exclude content.
- Click Files and navigate to each folder you want to exclude.
- Hover over a folder and click Add to exclude list.
- When you’ve added all the folders, click Exclude selected and confirm.
Important: exclusion applies retroactively. If you exclude a folder, it disappears from your existing backups, not just the next one. If there’s anything in those folders you might need to restore later, copy it elsewhere first.
Step 3: Run the backup
Return to the Backups screen and click Backup Now. If it completes, you’re done and the exclusions apply to all future scheduled backups automatically.
If you still hit the error, run the Code Snippet again to find the next-largest folders. Some sites need two or three exclusion passes before the file count drops below the limit. Common second-pass targets:
wp-content/cacheif any caching plugin stores file-based cachewp-content/backuporwp-content/backupsif another backup plugin is activewp-content/uploads/cacheused by some image optimization plugins- Old, unused theme directories in
wp-content/themes
What to keep in mind for next time?
File count is what triggers this error, not file size. The sites most likely to hit it are WooCommerce stores, sites running image optimization plugins, and sites that have accumulated old plugin or theme directories over years.
Run the Code Snippet from Step 1 every few months as a quick health check. Catching folder bloat early is faster than dealing with a failed backup later.
Still stuck?
If multiple exclusion passes haven’t resolved it, your site likely has an edge case beyond what the standard fix covers. Contact ManageWP support with:
- The website URL where the error occurred
- The folders you’ve already excluded
- The output from the Code Snippet showing your current file count distribution
That information lets the support team skip diagnostics and dig straight into your specific case.
Frequently Asked Questions
Why does file count matter more than file size for backups?
ManageWP’s incremental backup tracks each unique file individually so it knows which ones changed between backups. The internal limit is on how many files the system can track, not on total storage. A site with a few large videos hits the limit much later than a site with hundreds of thousands of small image thumbnails.
Can I get back my excluded files if I change my mind?
Not from your existing ManageWP backups: once excluded, those files are gone from previous backups too. If the files still exist on your live site, future backups will include them again as soon as you remove them from the exclude list. If they don’t exist on your site anymore, you’d need to restore them from another source.
Will the Code Snippet slow my site down?
The script reads your wp-content/uploads directory and counts files. On most sites it runs in under a few seconds. On very large sites with millions of files, it can take longer, but it’s a read-only operation that doesn’t modify anything. It’s safe to run during normal site traffic.
Does this error affect my live site or just the backup?
Just the backup. Your live site keeps running normally regardless of whether the backup completes. The error means the backup process can’t finish, but no other ManageWP feature or your WordPress site itself is affected.