How to Fix Broken Images in WordPress (Media Library Not Showing)

On this page
Grey boxes, broken image icons or an empty media library are alarming, but broken images in WordPress usually come from one of a few causes. Work through these checks in order.
Step 1: Open the image URL directly
Right-click the broken image and choose "Open image in new tab" (or copy its address from the page source). The result tells you the cause:
- 404 Not Found: the file is missing or the URL is wrong (Steps 2-3).
- 403 Forbidden: permissions or hotlink protection (Step 4).
- The image opens fine: it is blocked as mixed content or by a plugin/CDN (Steps 5-6).
Step 2: Wrong URLs after a migration or domain change
The database may still point to the old domain or a staging address. Back up first, then use a reputable search-and-replace tool to replace the old URL with the new one. Never edit serialized data by hand.
Step 3: Missing files
Check wp-content/uploads/year/month/ in File Manager. If files are missing, the migration or backup did not include uploads; restore them from a backup (see backing up WordPress).
Step 4: Permissions and hotlink protection
- Folders in
wp-content/uploadsshould normally be 755 and files 644. - Hotlink protection in your hosting panel or CDN may block your own domain or subdomain if misconfigured.
Step 5: Mixed content after switching to HTTPS
Images referenced with http:// on an https page are blocked. Update the URLs (see fixing "Not secure" and mixed content).
Step 6: Plugins, lazy loading and CDN
- Temporarily disable image optimization, lazy-loading and CDN plugins to see whether one is rewriting URLs incorrectly.
- Purge the CDN and caching plugin after fixing URLs.
Step 7: Uploads fail or the media library is empty
- Check Settings > Media on older sites for a wrong upload path.
- Upload errors about size: see the upload size guide.
- If thumbnails are missing after a theme change, regenerate them with a thumbnail regeneration plugin.
Tip: while fixing images, compress and convert them to WebP so pages load faster. See how to optimize images in WordPress.
Frequently asked questions
Why did my images break after moving my site?
The database still contains the old domain or folder in image URLs. A careful search-and-replace of the old URL with the new one, after a backup, fixes it.
Why are images missing only on HTTPS?
They are still loaded over http://, which browsers block as mixed content on a secure page. Update the URLs to https://.
What file permissions should the uploads folder have?
Folders are normally 755 and files 644 on most hosts. Your host's support can correct permissions if they were changed.
Do I need to regenerate thumbnails?
If you changed themes or image sizes and some sizes look wrong or missing, a thumbnail regeneration plugin recreates them from the originals.


