Guide
How to find broken images in WordPress
A broken image is easy to miss: the post still loads, there's just an empty box or a small icon where the picture should be. Here's how to find them across your site and why they appear in the first place.
Why images break
- The file was deleted from the Media Library, while a post still points to it.
- The site moved to a new domain or from http to https, and old posts still use the full old address.
- The image lives on another site, such as a partner's server or an old CDN, and that site removed it.
- The upload folder changed after a migration, a backup restore or an offload plugin that was later switched off.
Option 1: check one page in your browser
Open the page, press F12 to open the developer tools and go to the Console tab. Reload the page. Every image that fails shows up as a red line with 404 (Not Found) or a similar error. The Network tab, filtered to Img, shows the same list with the status of each request.
This is quick and precise, but it only covers the page you have open.
Option 2: crawl the whole site
A desktop crawler such as Screaming Frog SEO Spider loads every page and records each image it finds. Filter the images by status code to see the ones that return 404. The free version crawls up to 500 URLs. You still need to open each post in WordPress to replace the image afterwards.
Option 3: a link checker that also checks images
Most link checker plugins look at <a href> links. The free Hrefix plugin also checks the <img src> address of every image in your published posts, pages and public custom post types, on your own server and without an account.
- Install Hrefix from Plugins > Add New and activate it.
- Go to Tools > Hrefix and click Start link checking.
- Hrefix collects the links and image addresses from your content and checks them in small batches in the background.
- Broken images appear in the same list as broken links, with the post they're in. Edit the address there, or open the post to replace the image.
Broken items are rechecked daily and working ones every 7 days, so an image that disappears next month shows up without you running anything.
How to fix a broken image
- The file is gone: upload it again, or pick a replacement in the block editor (select the image block and choose Replace).
- The address still uses the old domain or http: fix it once for the whole site instead of post by post. A search and replace tool such as WP-CLI's
wp search-replaceor the Better Search Replace plugin can change every old address in the database. Take a backup and do a dry run first. See checking links after a WordPress migration. - The image came from another website: download it (if you're allowed to use it) and upload it to your own Media Library, so it can't vanish again.
- The file exists but the server refuses it: check that the upload folder's permissions weren't changed during a migration, and that a security plugin isn't blocking images loaded from other sites.
Prevent it next time
- Before deleting a file from the Media Library, check its Uploaded to field to see which post uses it. It doesn't show every use, so search your posts for the file name too.
- Keep images on your own site rather than embedding them from other sites.
- After any migration, run a full check of links and images before you announce the new site.
Want this done inside WordPress? Hrefix is a free plugin that finds broken links on your own site, with no account and no cloud service. Hrefix Pro (from €39 per year) adds a 404 monitor, a bulk redirect fixer and a weekly email report.