Skip to content
WordPress Guide

How to Replace an Image in WordPress (Same URL or New)

How to swap a picture in one block, find everywhere an image is used, replace the file while keeping its address, and deal with caches showing the old one.

A woman working on a tablet with a keyboard at a cafe table
7 sections · 7 min read
In this article · 7 sections

The team photo is three people out of date. The product shot shows last year’s packaging. The logo has been redrawn. You uploaded the new picture, and now you are staring at the Media Library wondering how to make every page use it, without hunting through forty pages and without breaking anything.

How you replace an image in WordPress depends on one question: do you want to change the picture in one place, or swap the file everywhere it is used, keeping the same address? WordPress handles the first by itself. The second needs either patience or a plugin.

Swapping the image in one block

If the picture appears on a single page, this is all you need.

  1. Open the page in the editor and click the image.
  2. In the block toolbar, click Replace.
  3. Choose Open Media Library to pick an image already uploaded, or Upload to add a new one.
  4. Check the Alternative text in the sidebar. Replace keeps the block’s settings, but the old description may not fit the new picture.
  5. Update the page.

Alignment, size, link and caption usually carry over, which is why Replace is better than deleting the block and adding a new one. The Cover, Media & Text and Gallery blocks have similar replace options in their toolbars.

The old file stays in the Library and keeps its own address. Nothing else on the site changes.

Finding everywhere an image is used

Before you decide which method suits, work out where the old image appears. WordPress has no built-in “used on” report, so check these places:

  • Page and post content. In Pages → All Pages or Posts → All Posts, type the image’s file name (without the extension) into the search box. The search looks through content, so pages that contain the image usually show up. This does not catch page builders that store layouts separately.
  • Featured images. These are settings, not content, so the search above misses them. Check your blog page and the posts likely to use the photo. Changing one is covered in our guide to choosing a featured image for a post.
  • Theme areas. The logo, header images and footer live in Appearance → Editor on block themes, or Appearance → Customize and Widgets on classic themes.
  • Page builder layouts and templates. Elementor and similar tools keep their own image settings in each widget.
  • Outside the site. Emails, social posts, Google Business Profile, a supplier’s website that links to your product photo. You cannot edit those, which is the main argument for keeping the same address.

If the image is in two or three places, replacing each by hand with the block method is quick and safe. If it is everywhere, or linked from outside, read on.

How to replace an image in WordPress everywhere, keeping the URL

Core WordPress never overwrites a file. Upload team.jpg again and it becomes team-1.jpg, with a new address, while every page carries on showing the old one. To update an image at the same URL, you need a media replace plugin. Enable Media Replace is the best-known example; others work in a similar way.

With a plugin of this kind installed, the routine is roughly this:

  1. Take a backup, or at least keep a copy of the old image on your computer.
  2. Go to Media → Library, switch to the list view, and find the image. The plugin adds a replace option to the image’s row or details.
  3. Upload the new file.
  4. Choose the replacement type. Plugins usually offer to keep the existing file name and address (replace only the file), or to use the new file’s name and try to update links across the site. For a same-address swap, keep the existing name.
  5. Confirm. The Library item keeps its ID, so featured images, galleries and blocks that use it point at the new picture.
  6. Check a page that uses the image, in a private browser window.

Some practical points:

  • Keep the same file type. A JPEG swapped for a PNG under the old name either gets refused by the plugin or ends up with an address that does not match the file. Convert the new image to the same type first.
  • Keep a similar shape. If the old image was wide and cropped by the theme, a square replacement may crop oddly in places you never thought about.
  • Check the alt text. The Library item’s description stays as it was; update it if the picture is different, and remember that blocks keep their own copy of alt text.

The same approach updates a PDF without breaking links to it, which our guide to putting a PDF on a WordPress page discusses for price lists and menus.

“I replaced it, but the old one still shows”

Almost always a cache, and there can be several layers holding the old picture:

  1. Your browser. Open the page in a private window, or hard refresh with Ctrl+Shift+R (Cmd+Shift+R on a Mac).
  2. A caching plugin. Clear its cache from its admin bar menu or settings page.
  3. Your host or CDN. Many hosts and services like Cloudflare keep copies of images. Purge the cache in their dashboard, or for one image, purge that file’s address.
  4. Image optimisation plugins. If a plugin made a WebP copy of the old picture, it may keep serving that copy. Re-run its optimisation on the replaced image.
  5. Resized copies. WordPress made smaller versions of the old upload. Good replace plugins regenerate them; if a thumbnail still shows the old picture, regenerate thumbnails for that image.

Social media previews are cached separately by Facebook and LinkedIn, and Google Images updates on its own schedule. Neither changes instantly, and neither is something your site controls.

Old file names and leftover files

If you replaced images block by block, the old files are still in the Library. That is not urgent; unused images do no harm except taking space. Resist deleting them straight away. A page you forgot, or an external link, may still use them, and once a file is deleted those places show a broken image.

When you are sure, note the old file names and remove them in a planned clear-out. Our post on tidying the Media Library safely covers how to tell what is truly unused.

A word on names: if the new image shows something different, such as new packaging, a same-name swap leaves an old name on a new picture. That is harmless for visitors. If the name matters to you, use the plugin’s option to rename and update links, after a backup, and check the pages afterwards.

Shortcuts that backfire

  • Deleting the old image first and uploading the new one second. Every page using it breaks in between, and possibly for good.
  • Running a search-and-replace on the database for image addresses without a backup. Tools like Better Search Replace are powerful and unforgiving.
  • Uploading the new photo at full camera size because “it is only a replacement”. Prepare it like any other upload.
  • Assuming the change is live because the editor shows it. Always check the public page.

How images, uploads and their copies fit together is laid out in our WordPress images and media guide, part of our longer series on managing your WordPress site.

Frequently asked questions

Will replacing an image affect my SEO?

Not in a harmful way. If the address stays the same, search engines simply see a new picture at that address when they next visit. If the address changes, the old image may linger in image search for a while and then drop out. Either way, give the new image accurate alt text and the page itself is unaffected.

Can I replace an image without installing a plugin?

Yes, by uploading the new file and swapping it into each block, featured image and theme setting that uses the old one. That is manageable when the image appears in a few places. Replacing the file over FTP with the same name is possible but leaves WordPress’s resized copies showing the old picture, so it is not recommended.

Should I keep a replace plugin installed afterwards?

Many owners do, because the same need comes back every time a menu, price list or team photo changes. If you only needed it once, deactivating and deleting it afterwards is fine; the replaced files stay as they are. Like any plugin, keep it updated while it is installed.

Why did the replacement change the image size on my page?

The block may be set to a fixed width or a particular resolution that suited the old picture, or the new image has different proportions. Select the image, check the Resolution and width settings in the sidebar, and choose a size that fits. Resizing the new file to roughly match the old dimensions before uploading avoids most of this.

When one photo turns up across dozens of pages, builder layouts and theme settings, finding every copy is tedious rather than difficult. If you would rather not spend an afternoon on it, our WordPress support service takes on that kind of one-off job.

Next in this series: WordPress Cover Block: Build a Readable Hero Image

Is Your Website Working Properly?

Get a free website health check from WebMaintor. We'll review your website's speed, security, forms, and technical health — and tell you exactly what needs attention.

No obligation. No automated reports. A real review by our team.