Merchlint
Available now
Next, in this order
  • DeutschDE
  • EspañolES
  • FrançaisFR
  • ItalianoIT
  • PortuguêsPT
  • NederlandsNL
  • SvenskaSV
  • TürkçeTR

A language shows up here once its pages are actually written. Nothing on this site is machine-translated, except a few German and Spanish pages that no native speaker has reviewed yet.

Install free Install
← All checks

The image file is missing

WordPress still lists the image, the product page still asks for it, and the file is not on disk. The admin looks healthy; the storefront shows a gap.

Group
Media
Confidence
F — fact read directly from your store
Name on the plugin screen
Image with no file
Included in
the free plugin
Updated
Code
D6

The symptom

A product page with a blank space, a broken-image icon, or a placeholder where the photograph should be. In the Media Library the image is listed by name and looks like any other attachment—its thumbnail may even still render from a cached variant.

The row in the database is intact. The file it points to is not on the server.

This almost always arrives in one of four ways: a migration that copied the database but not wp-content/uploads, a staging sync that ran in the wrong direction, a media-offloading plugin that was removed while the files were still on the remote, or a well-meant clean-up of the uploads folder.

What it costs

  • The product looks broken, not just unillustrated. A missing photograph reads as neglect, and the judgment lands on the whole store, not on the one product.
  • It costs sales. Few people buy a product they cannot see.
  • It is invisible from the admin. Product lists show the image title, not whether the file exists. Nothing in WordPress checks this on its own.
  • Backups can carry it forward. A database backup restored onto a server whose uploads were never restored produces exactly this state, at scale.

How to check it yourself

This one cannot be answered by SQL, because the question is about the filesystem. WP-CLI can ask both sides at once:

wp eval '
foreach ( get_posts([
    "post_type"      => "attachment",
    "post_mime_type" => "image",
    "posts_per_page" => -1,
    "fields"         => "ids",
]) as $id ) {
    $file = get_attached_file( $id );
    if ( $file && ! file_exists( $file ) ) {
        printf( "%d\t%s\n", $id, $file );
    }
}'

On a large library this walks every attachment, so run it outside peak hours. If it prints nothing, every image WordPress knows about is where WordPress expects it.

How to fix it

  1. Find out whether the files exist anywhere before touching the database. A backup, the old server, the staging copy, the offload bucket. Restoring the folder is always cheaper than re-shooting or re-sourcing photography.
  2. If they are gone, replace the image on the products that use it, then delete the orphaned attachment. Deleting the attachment first leaves products with no image and no record of what the image was.
  3. Check the count. Two missing files is an accident; two thousand is a migration that did not finish, and the repair is to finish it rather than to fix products one at a time.
  4. After any migration, run the check again. This is the single most useful moment for it.

When it’s a false alarm

  • Offloaded media. If your images live on S3, R2 or a similar service, the local file is legitimately absent by design and the site serves them from the remote perfectly well. This is the most common false alarm by a wide margin. If you offload, this check tells you nothing useful: hide the findings, and they stay hidden across scans.
  • A CDN that rewrites URLs without moving files still keeps the local copy, so it is not affected.

How Merchlint finds it

Merchlint takes the main image of every published product, and each variation’s own image, and asks the filesystem whether the file is there. It also catches two broken records: an image entry with no file path at all, and a product that points to an image entry that no longer exists. This check makes no network requests, so it works the same way on a local copy, a staging site and the live store.

Because one image can belong to many products, the finding points to the image. Fixing it once fixes every product that uses it. The finding shows the image and one product that uses it.

Confidence: F—fact from the database and the filesystem. The path leads to a file, or it does not.

Run this check on your store

Doesn't match what you see in your store? Email us—we read every message. contact@merchlint.com