Images not loading: find the cause and fix it

PlatformAny website Doing it yourself10 to 40 minutes Checked

Written and checked by Sajid, Founder & Web Engineer

The short answer

A broken image means the page asked for a file the browser could not get. The usual reasons are a wrong or changed file path, the file being missing or deleted, an http image on an https page (mixed content), or the host blocking the request. Open the browser console to see the exact address that failed, and the reason is usually clear from there. The page itself is fine; it is pointing at the wrong place for the picture.

Is this your problem?

  • Images show a broken-image icon, a blank box, or the alt text instead of the picture
  • It started after a move, a redesign, or switching to https
  • Some images load and others do not, often the newer or the older ones
  • Images load for you but not for visitors, or the other way round
  • The browser console shows 404 or "mixed content" for the image files

What usually causes it

1
A wrong or changed file path

How to tell: The address in the page points at a folder or domain that no longer holds the file, often after a move or redesign.

2
The image file is missing

How to tell: The file was not copied over, was deleted, or was never uploaded.

3
Mixed content on an https site

How to tell: The image is linked over http on an https page, so the browser blocks it as insecure.

4
Hotlink protection or a block

How to tell: The host blocks images loaded from, or to, another domain, so they fail.

5
A broken CDN or image plugin

How to tell: An image CDN or optimisation plugin is misconfigured or down, so the rewritten image address fails.

Before you touch anything

  • Open the browser developer console (right-click, Inspect, Console) and reload. The failed image address and the reason are listed there.
  • Note whether all images fail or only some, and whether it followed a move or an https switch.

How to fix it, step by step

  1. 1

    Read the failed address in the console

    The console shows the exact URL that failed and whether it is 404 (missing or wrong path) or mixed content (http on https). That names the cause.

  2. 2

    If the path is wrong, re-point it

    After a move or domain change, image addresses may still point at the old location. Update them, or run a safe search-and-replace of the old path for the new one.

  3. 3

    If the file is missing, re-upload it

    Confirm the file exists at the address the page expects. If not, upload it there, or re-add the image so the correct path is written.

  4. 4

    Fix mixed content

    If the console says mixed content, change the image links from http to https, or use a plugin that rewrites insecure URLs. See our page on mixed content for the full fix.

  5. 5

    Check hotlink protection and the CDN

    If images load directly but not on the page, hotlink protection may be blocking them; allow your own domain. If an image CDN is in front, confirm it is set up and reachable.

  6. 6

    Clear caches and recheck

    Clear the site and CDN cache so corrected image addresses are served, then reload with a hard refresh.

Stop and get help if

  • The console shows the files are genuinely gone and there is no backup of the images.
  • It is a shop and product images are missing, costing sales.
  • An image CDN or plugin rewrote every address and undoing it safely is unclear.
Fix it for me

Stop it happening again

  • When moving or redesigning, carry the media files over and update image paths deliberately.
  • Keep the site on https and link images over https, so nothing is blocked as mixed content.
  • Keep a backup of your media library, not just the database.
  • Test a few pages with the console open after any big change.

Questions people ask

Why do some images load and others not?

The broken ones usually have a wrong path, were never uploaded, or are linked over http. The console shows which for each.

They load for me but not visitors. Why?

Often your browser cached them before they broke, or a CDN is serving you a cached copy. Check in a private window.

Is this a hack?

Rarely. Broken images are almost always a path, a missing file or a mixed-content problem, not a break-in.

Not sure where your site stands?

Paste the address. Security, speed, SEO and how old the tech is, in about ten seconds.

Still broken? We can fix it.