WordPress Media Library Showing Broken Images — Thumbnails Missing: Complete Fix

You go to Media Library in wp-admin. You uploaded 50 images yesterday. But today, you see grey placeholder tiles instead of thumbnails. Or a grid of broken-image icons. Every single one. You click on an image to edit it—and suddenly it displays perfectly fine. But back in the grid view, it's broken again. The files exist. WordPress knows about them. Something in between is broken.


What's Actually Happening

Your media library grid view does three things for every image on every page load:

  1. Query the database for attachment posts in wp_posts table
  2. Read the file path stored in the _wp_attached_file post meta in wp_postmeta
  3. Build a thumbnail URL from that path and display it in a grid tile

If any of these three fail, you see a broken image icon instead of a thumbnail. But here's the trick: clicking Edit → viewing the attachment details page usually works fine. Why? Because the details page loads the image directly from the filesystem or database, not from the web URL.

So if the grid view is broken but the edit page shows the image, your problem is not that the image files are missing. Your problem is that the database path doesn't match the real path, or the thumbnail generation failed when the image was uploaded.


Root Causes of Broken Thumbnails

Cause #1: Corrupted or Missing _wp_attachment_metadata

When an image is uploaded, WordPress generates thumbnail sizes and stores all the file paths in a database entry called _wp_attachment_metadata in the wp_postmeta table.

If this entry is:

  • Empty or NULL
  • Corrupted by a server crash or plugin bug
  • Partially deleted (some thumbnail sizes missing)

Then WordPress doesn't know what thumbnail sizes to display in the grid, and it shows a placeholder.

Common trigger: Server crash after upload, plugin update that corrupts metadata, or a buggy migration.

Cause #2: Upload Path Doesn't Match Actual Path

WordPress stores the relative path in _wp_attached_file (e.g., 2026/10/image.jpg) and combines it with the upload base URL from wp_options.

If you:

  • Migrated the site to a new server
  • Changed the site URL in WordPress settings
  • Moved the uploads folder to a custom path
  • Changed the upload_path option in wp_options to an absolute path (should be empty/null)

Then the constructed URL doesn't point to where the actual files are. WordPress tries to load the image from the wrong location—and the browser gets a 404, showing a broken icon.

Example: After migration, WordPress looks for the image at http://oldserver.com/uploads/2026/10/image.jpg but it's actually at http://newserver.com/uploads/2026/10/image.jpg. Broken image.

Cause #3: Thumbnail Generation Failed (GD Library / ImageMagick Issue)

When you upload an image, WordPress uses either the Imagick or GD Library to generate multiple thumbnail sizes (thumbnail, medium, large, etc.). If neither library is installed, enabled, or working properly, thumbnail generation silently fails.

The original image is saved. But WordPress can't create the smaller versions. The _wp_attachment_metadata is empty or incomplete.

You see no thumbnails in the grid.

Common triggers:

  • GD Library disabled in php.ini
  • ImageMagick installed but broken (JPEG library version mismatch)
  • Recent PHP upgrade that disabled image libraries
  • New hosting where neither library is compiled in by default

Cause #4: Plugin Conflict or Cache Issue

A plugin that modifies the media upload process or caches image URLs can corrupt the database entries. Or a caching plugin serves a stale thumbnail URL that no longer exists.

Cause #5: File Permissions Issue

If the /wp-content/uploads folder or its subdirectories have incorrect permissions (not 755 for directories, 644 for files), the web server can't read the files or the thumbnail generation process can't write the resized images.


Diagnosis: How to Find the Problem

Step 1: Check Site Health First

  1. Go to WordPress admin → Tools → Site Health
  2. Look for the "Media Handling" section
  3. Check if Imagick or GD Library is available

If both are listed as missing or broken, that's your main problem. Go to Fix #3.

Step 2: Check if Files Actually Exist

Use FTP or cPanel File Manager:

  1. Navigate to /public_html/wp-content/uploads/[year]/[month]/ (where your images should be)
  2. Look for the image files

If files exist: The problem is database-related (causes #1 or #2). Go to Step 3.

If files are missing but WordPress says they exist: The real issue is the upload path is pointing to the wrong folder. Go to Step 3.

Step 3: Check Upload Path Settings (phpMyAdmin)

  1. Go to phpMyAdmin
  2. Click on wp_options table
  3. Look for two rows: upload_path and upload_url_path

What you should see:

Setting Correct Value If Wrong, Means…
upload_path Empty or NULL Points to custom/wrong folder. Set to empty.
upload_url_path Empty or NULL Points to wrong URL. Set to empty.

If upload_path is set to an absolute path (like /home/user/public_html/articlefiles or just wp-content/uploads), that's a common migration mistake. Fix #2 will restore it.

Step 4: Test the Thumbnail URL Directly

  1. Open the broken image in the media library
  2. Right-click the broken thumbnail placeholder
  3. Select "Copy Image URL" (or inspect the src attribute)
  4. Paste it into a new browser tab

If you get a 404 (page not found): The URL is pointing to the wrong location. Fix #2.

If the image displays perfectly: The file exists and is accessible. The problem is WordPress media library metadata. Fix #1.

Step 5: Check Permissions

Via FTP, right-click /wp-content/uploads folder and check permissions:

  • Directories should be 755
  • Files should be 644

If they're wrong, change them. But this is rarely the issue with displaying thumbnails—it usually causes upload failures.


Fix #1: Regenerate Thumbnails

Use this if: Files exist and are accessible, but thumbnails show as broken in the grid.

Install the Regenerate Thumbnails plugin or use the RegenerateWP free plugin:

  1. Go to WordPress admin → Plugins → Add New
  2. Search for "Regenerate Thumbnails" or "RegenerateWP"
  3. Install and activate
  4. Go to Tools → Regenerate Thumbnails (or the plugin's menu)
  5. Click "Regenerate All Thumbnails"
  6. Wait for the process to complete (can take a few minutes for hundreds of images)

This forces WordPress to recreate all thumbnail sizes for all images. If the image files exist but the _wp_attachment_metadata is broken, this will fix it.

Alternative via WP-CLI (if you have command-line access):

wp media regenerate --only-missing

Fix #2: Fix Upload Path Issue (Migration or Path Change)

Use this if: You migrated the site, changed the site URL, or the upload_path in phpMyAdmin is wrong.

Step A: Clear upload_path and upload_url_path

  1. Go to phpMyAdmin → wp_options table
  2. Find the row where option_name = 'upload_path'
  3. Click Edit
  4. Set option_value to empty (leave it blank)
  5. Click Save
  6. Repeat for 'upload_url_path'

When both are empty, WordPress automatically uses the default: wp-content/uploads

Step B: Fix Database Paths (Search and Replace)

If you migrated from one domain to another, you need to update all the image URLs stored in wp_posts and wp_postmeta.

Install the Better Search Replace plugin:

  1. Go to WordPress admin → Plugins → Add New
  2. Search for "Better Search Replace"
  3. Install and activate
  4. Go to Tools → Better Search Replace
  5. In "Search for", enter the old domain: https://olddomain.com
  6. In "Replace with", enter the new domain: https://newdomain.com
  7. Make sure "Run as dry run" is checked first (to preview changes)
  8. Click "Search and Replace"
  9. Review the results
  10. If correct, uncheck "Run as dry run" and do it again

Alternative via WP-CLI:

wp search-replace 'https://olddomain.com' 'https://newdomain.com' --dry-run
wp search-replace 'https://olddomain.com' 'https://newdomain.com'

After this, go back and regenerate thumbnails (Fix #1).


Fix #3: Fix Image Processing Library (GD / ImageMagick)

Use this if: Site Health shows "Imagick Not Available" and "GD Not Available", or no image resizing is happening at all.

Via cPanel (Shared Hosting)

  1. Go to cPanel → Select PHP Version (or PHP Extensions)
  2. Look for "gd" or "imagick"
  3. Check the checkbox to enable it
  4. Click "Save" or "Confirm"
  5. Go to WordPress → Tools → Site Health and refresh

Enabling GD should solve the problem in 90% of cases.

Via Contact Your Host

If cPanel doesn't show the option:

  1. Contact your hosting support
  2. Ask them to enable GD Library (or Imagick) for your account
  3. If they say it's not available, consider switching hosts

Then after GD is enabled, regenerate thumbnails (Fix #1).


Fix #4: Disable Plugins (Rule Out Conflicts)

  1. Go to WordPress admin → Plugins
  2. Deactivate all plugins (yes, all of them)
  3. Check the media library—are thumbnails showing now?
  4. If yes, reactivate plugins one by one to find the culprit
  5. If no, the problem is not a plugin

Fix #5: Clear Cache

If you're using a caching plugin (WP Super Cache, W3 Total Cache, etc.):

  1. Go to the caching plugin's settings
  2. Click "Purge Cache" or "Clear Cache"
  3. Go to WordPress → Settings → General
  4. Copy the site URL, then click somewhere else on the page (this triggers a cache clear)
  5. Reload the media library

Complete Troubleshooting Checklist

Check What to Do Fix If Broken
GD Library or ImageMagick available Tools → Site Health → Media Handling Enable in cPanel or contact host (Fix #3)
Image files exist on server FTP → /wp-content/uploads/[year]/[month]/ If missing, check upload_path setting (Fix #2)
upload_path is empty/null phpMyAdmin → wp_options Set to empty (Fix #2, Step A)
upload_url_path is empty/null phpMyAdmin → wp_options Set to empty (Fix #2, Step A)
Site URL matches current domain Settings → General Update if migrated (Fix #2, Step B)
Thumbnail generation working Upload new image, check grid immediately If still broken after upload, check GD (Fix #3)
No conflicting plugins active Deactivate all plugins, test (Fix #4) Reactivate one by one, find culprit
Folder permissions correct FTP → /wp-content/uploads → Properties Set to 755 (directories), 644 (files)

Prevent Broken Images in the Future

1. Before every migration: Test a dry-run or staging environment first. Document your current upload_path and upload_url_path (should both be empty). After migration, test one image upload to confirm thumbnails generate.

2. Keep backups of wp_options: Use a backup plugin like UpdraftPlus that includes database backups. If migration corrupts your options, you can restore.

3. Keep GD Library enabled: Check Site Health monthly. If GD or ImageMagick suddenly disappears, contact your host immediately.

4. Update plugins regularly: Outdated media-handling plugins are common sources of corruption.

5. Never manually set upload_path to an absolute path: Always leave it empty. WordPress will figure it out.


The Real Talk

Broken media library images are scary because they look like you've lost data. You haven't. The images are still on your server. WordPress just doesn't know where they are, or the web browser can't reach them. The fixes are almost always simple: either clear the wrong upload path, regenerate thumbnails, or enable an image library that WordPress needs to generate those thumbnails in the first place.

The hardest part is figuring out which of the five causes is yours. Start with Site Health. If that says GD is missing, you're done—enable it. If Site Health is green and files exist, regenerate. If you just migrated, search-replace the domain. Follow the diagnosis steps in order and you'll find it.

Last updated: October 2026. Real data: WordPress.org support forums (2010–2026), WordPress Core documentation, Roots.io discourse, WP-CLI documentation, hosting provider resources (cPanel, Plesk, WebSavers).