Guide · WordPress, December 2026

How to fix broken images in WordPress

A broken image shows as an empty box, a small icon or just the alt text. It looks careless, and on a product or tutorial page it can stop the page doing its job. The cause is almost always the same: the address in the post points to a file that is not there any more. Here is how to find those addresses and fix them without a plugin.

1. Find the address that fails

  1. Open the page with the broken image in your browser.
  2. Right-click the empty space where the image should be and choose Inspect, or press F12, and open the Network tab.
  3. Reload the page. Requests that failed are listed in red, usually with a 404 (not found). Filter by Img to see only images.
  4. Click the failed request and copy its full address. That is the exact address your post is asking for.

Look at the address. Is it on your own domain or another one? Is it http:// or https://? Does the folder look like a date path under wp-content/uploads? The answers point to the cause.

2. Work out why it fails

  • The file was deleted from the Media Library. Check Media in the admin and search for the file name. If it is gone, you need to upload it again.
  • The site moved or changed domain. The address in the post still has the old domain or a staging address, and the file is not served from there any more.
  • The image lives on another website. A hotlinked image breaks when the other site removes or renames the file. You do not control it.
  • The address uses http on an https site. Browsers can block or rewrite insecure images on a secure page, so the image fails even though the file exists. Open the address with https to check.
  • A typo or a changed file name. A single wrong letter, or a renamed file, gives a 404 for a file that exists under another name.

3. Replace the image in the post

  1. Open the post or page in the editor and click the broken image block.
  2. In the block toolbar choose Replace, then pick the image from the Media Library or upload the file again.
  3. Click Update. WordPress saves a revision, so you can go back if the result is wrong.

If the image came from another website, check you are allowed to reuse it before you download and upload it yourself. If you are not sure, use your own image or one with a licence that allows it.

4. Fix an old domain in bulk

If hundreds of images broke because the site moved, editing posts one by one is slow. WP-CLI can replace the old address everywhere in the database:

  1. Take a database backup first. This changes every match.
  2. Run a dry run to see what would change: wp search-replace 'https://old.example.com' 'https://www.example.com' --dry-run
  3. If the counts look right, run the same command without --dry-run.
  4. Reload a page that was broken and check the Network tab again.

WP-CLI's search-replace handles serialized data, which a plain text replace in a database editor can corrupt. If you do not have shell access to your host, ask them or use a well-known migration tool instead of editing the database by hand.

5. Keep it from happening again

  • Upload images to your own Media Library instead of hotlinking them from other sites.
  • Before you delete a file from the Media Library, search your posts for its file name.
  • After a domain change or a move from staging, check a few pages with the Network tab on the same day.
  • Check your important pages every month or two. Links to other sites break without warning, and so do their images.
  • For links rather than images, see how to find and fix broken links in WordPress.

6. When to add more

The steps above find one page at a time. On a site with hundreds of posts that does not scale, and a hotlinked image can break next month without anyone noticing. We are building LinkMend, a WordPress plugin that checks from your own server:

  • With Images turned on in its settings, a scan checks every image address (img src) in your published posts and pages along with the links, and lists the ones that fail.
  • Each failing image shows which posts use it, with an edit link to each.
  • Replace everywhere swaps a bad image address for a new one in every post that uses it, in one step. The change goes through WordPress's normal update, so a revision is saved where revisions are on.
  • No account and no cloud service: the checks run on your server and your addresses are not sent to us.
Coming soon. LinkMend is not on wordpress.org yet. Read how it works on the LinkMend page and in the documentation, or see how it compares with other broken link checkers.

We build LinkMend. Everything in steps 1-5 works without it. This guide was written with AI assistance. The WordPress and WP-CLI steps were checked against their official documentation, not a live site, and the plugin details against its code. Screens can change between versions; if yours look different, search the official help for the feature name.

LinkMend – Local Broken Link Checker is built by Volution Technology.