WordPress Media

Can You Bulk Replace Files in the WordPress Media Library?

Quick answer

The Media Library lets you select a lot of files at once and do things like delete them. What it does not let you do is take a folder of new files, work out which existing file each one replaces, check the ones it is unsure about, and replace them all as one job you can undo.

For a handful of files, doing it by hand is fine.

For dozens or hundreds, the thing you are missing is not upload speed. It is working out where everything goes, checking it, and being able to put it back.

Selecting a lot of files is not replacing them

The Media Library is good at handling many items at once.

But “select 100 files” is a different question from:

“I have 100 new files. Which 100 files already on my site should they replace?”

Answering that means keeping track of, for every file: the new file, the one it is replacing, what you decided about it, whether it was safe to go ahead, and what actually happened.

WordPress has nowhere to keep any of that.

What WordPress does give you

Out of the box you get:

  • uploads
  • titles, captions and alt text
  • basic image editing
  • selecting several items at once
  • deleting
  • search and filters
  • a URL for every file.

What it does not give you:

  • suggestions for which file replaces which
  • a queue of the uncertain ones to check
  • a sensible way to handle files that are brand new
  • a warning when two new files are aimed at the same place
  • a warning when the file you are replacing is used elsewhere
  • undo for one file.

Those are the parts WP Bulk Replace adds.

The usual ways people do it

By hand

Fine for a few files you already know the home of. Simple, nothing to set up.

It falls apart at scale: it is repetitive, it is easy to lose your place, and there is no single list of the ones that went wrong.

A single-file replacement plugin

Good when you can say “this exact new file replaces this exact one”.

It keeps the existing file in place, which is the main thing. But it is still one decision at a time.

FTP or SFTP overwrite

Fast, and it keeps the file path exactly as it was.

It also skips everything WordPress knows: no record of what changed, no check on what else is using that file, and undo means you going and finding a backup yourself.

WP-CLI or a script

Powerful, repeatable, and the right answer for a developer-run migration where the mapping is predictable.

The moment names are inconsistent or somebody other than you needs to check the uncertain ones, you are writing and maintaining that yourself.

A batch replacement workflow

Worth it when the filenames are inconsistent, the folder needs mapping before anything can happen, someone has to check the exceptions, you need to know a file is not used elsewhere, and the whole thing will come round again next term.

Why uploading files with the same names does not work

Uploading a file called the same thing does not overwrite the old one.

WordPress will usually put it in this month’s uploads folder, add -1 to the filename to avoid a clash, and create a second entry in the Media Library.

Your pages carry on pointing at the original. You now have two files and no indication of which is current.

Do the files have to be in the Media Library?

Not necessarily.

Established sites keep file references in:

  • custom fields
  • custom post types
  • plugin data
  • structured resource records.

A tool that only looks at the Media Library will not find those. WP Bulk Replace Pro covers ACF file, image and gallery fields — including inside repeater rows — and WooCommerce product images, galleries and customer downloads.

Files used in more than one place

One Media Library item can be used all over the site.

Replacing it can change several pages, several products or several resource listings at once.

Sometimes that is exactly the point. Sometimes it is a page you had forgotten about. Either way you want to be told before it happens, not after.

Brand-new files

A folder of revisions usually has some genuinely new documents in it too.

“There is nothing here to replace” is not a failure. If you know where the file goes and there is simply nothing there yet, it should be added — and the batch should still show you that it did that rather than a replacement.

Example: 100 replacement PDFs

You have 100 revised files. After uploading them, the batch reports:

  • 82 clear matches
  • 9 it is unsure about
  • 4 that are new documents
  • 3 held back because the file is used elsewhere
  • 2 where two new files are aimed at the same place.

That is a great deal more useful than a screen asking you to pick 100 files by hand. It tells you the 18 rows that actually need you.

FAQ

Does WordPress have a built-in replace-media button?

No — not for a batch, and not in a way that keeps the existing file in place.

Can I just upload files with the same names?

No. See above — WordPress creates a second copy rather than overwriting.

Is a plugin automatically safer than a script?

No. Safety comes from specific things: you get to review it, it stops when something is shared, it backs up before it writes, a retry does not redo work that already succeeded, you can see what happened, and you can undo one item.

Can batch replacement keep my URLs the same?

It can, where the file is stored in a way that allows it. Check the specific file and page you care about rather than assuming.

Summary

The Media Library manages media.

A bulk replacement tool manages something else: the relationship between the files you have been sent and the ones already on your site.

That is why selecting a hundred items does not solve it.

CTA: Download WP Bulk Replace Free

Related: Bulk replace files · Replace PDF without breaking links · FTP comparison