Home/Blog/WordPress
WordPress · Media · Cleanup

Find and Delete Duplicate Images in WordPress

Naveen Goyal
27 November 2026
3 min read
WordPress
Short answer

Duplicates come from re-uploads, imports and migrations. Find them by identical file content, not just by name, keep the copy your pages use, check the others are not in use, back up, then delete. A hash-based duplicate finder does the comparison for you.

Why WordPress fills up with duplicates

Every time the same photo is uploaded again, WordPress keeps it as a new file and adds -1, -2 to the name. Imports, migrations, page builders and shops that upload one photo per product variation all add more. Each upload also creates several thumbnail sizes, so one duplicate is really five or six files taking space and slowing backups.

Why searching by file name is not enough

Sorting the Media Library by name finds photo.jpg and photo-1.jpg, but misses the same picture saved as DSC_0042.jpg and banner-final.jpg. The reliable test is the file's content: two files with the same content hash are the same image, whatever they are called.

Before you delete anything

  • Take a backup of the uploads folder and the database.
  • Keep the copy your content uses. Deleting the file a page or product points to leaves a broken image.
  • Check featured images and galleries, not just post content; WooCommerce galleries are easy to miss.

Find duplicates by content

  1. Install a duplicate finder that compares file content (a hash), not names.
  2. Run the scan. It groups identical files together.
  3. In each group, keep the one that is in use, usually the oldest.
  4. Delete the extras, then check a few pages that used those images.
NaveenCodes Media Organizer does this from its Find Duplicates page: a hash-based scan of the whole Media Library, results grouped by identical content, and a safe delete that keeps the original. Its Unused Media page then lists files no post, page or featured image uses at all.

Stop duplicates coming back

  • Use media folders so people find the existing image instead of uploading it again.
  • To update a picture, replace the file instead of uploading a new one. Media Organizer's Replace File keeps the same URL and attachment ID, so nothing breaks.
  • Clear out unused media every few months; see how to delete unused images in WordPress.

Frequently asked questions

How do I find duplicate images in WordPress?

Use a duplicate finder that compares file content with a hash. Searching by file name misses copies saved under different names.

Is it safe to delete duplicate images?

Yes, if you keep the copy your content uses and take a backup first. Deleting the file a page points to leaves a broken image.

Why does WordPress add -1 to image names?

WordPress adds -1, -2 and so on when a file with the same name already exists in that month's uploads folder.

Do duplicate images slow down WordPress?

They don't slow page loads directly, but they make the uploads folder and backups bigger and the Media Library harder to use.

Free tool: Media Organizer

Media folders, a hash-based duplicate finder, an unused media finder and file replacement that keeps the URL.