Key takeaways
- Blank grid cells usually mean broken thumbnails, so regenerate them with a plugin or
wp media regenerate --yes. - An infinite loading spinner points to a failing REST or AJAX request, so check the browser console and Site Health first.
- Images that appear on the site but not in the library are files missing attachment rows in
wp_posts, common after FTP uploads or migrations. - Images broken on the live site usually come from stale
upload_url_pathvalues, rewrite rules, or CDN mappings after a move. - WordPress expects directories at 755 and files at 644; 777 is a security risk, not a fix.
When images in the WordPress media library are not showing, the cause is often one of four issues: broken thumbnails, incorrect upload folder permissions, a plugin or theme conflict, or a database sync failure. Each failure mode presents differently, and each has a specific fix. Find your exact symptom below and jump straight to the relevant section.
Why are images in WordPress media library not showing? Quick diagnosis table
Match your symptom below, then jump to the fix. Most cases come down to four causes: broken thumbnail regeneration, upload folder permissions, a plugin or theme conflict, or a database row that no longer matches the file. The database row matters because WordPress only shows an attachment in the library when wp_generate_attachment_metadata has run and the attachment is registered correctly, per the developer documentation on attachment metadata. If the underlying problem is a junk drawer of unused media and duplicates, cleanup is a separate job: FoldRocket handles folders and cleanup after the images display again.
| Symptom | Likely cause | Section |
|---|---|---|
| Blank grid cells | Broken thumbnails | Blank grid section |
| Infinite spinner | Plugin conflict or REST error | Spinner section |
| On site, not in library | Database sync issue | On-site section |
| In library, broken on site | File path or permissions | Broken images section |
Why does the WordPress media library show blank or empty grid cells instead of images?
Blank cells usually indicate one of three issues: the thumbnail files are broken, the original file is missing, or the image was never uploaded to your server. Work through the fixes below in order.
Regenerate thumbnails
Missing or corrupted image sizes are the most common cause. If a theme or plugin requested new dimensions and the generation failed mid-way, the grid has nothing to render. Install a regeneration tool and run it on the affected images, or use WP-CLI: wp media regenerate --yes. If the grid fills in afterward, you are done.
Check the uploads folder for the original file
Open /wp-content/uploads/ (via FTP or your host's file manager) and confirm the original exists at the path stored in the database. If it is missing, the image was deleted server-side or the site is hot-linking from another domain. Re-upload the original, then fix the attachment record.
Blank cells can also accumulate in neglected libraries full of duplicates and unused media. Our media library organizer comparison covers how cleanup tools can help prevent this issue.
Why does the media library get stuck on an infinite loading spinner?
Check browser console and Site Health
The grid view loads images through the REST API, so a spinner that never stops usually indicates a failing REST or AJAX request. Open DevTools (F12), check the Console tab for errors, and look at the Network tab for 4xx or 5xx responses to wp-json requests. Then run Site Health under Tools and check the "REST API" and "loopback requests" tests. WordPress documents common REST API errors and their troubleshooting in the Site Health docs. Mixed-content or CORS errors in the console point to a mismatch between http:// and https:// in your site URL settings.
Raise memory limit
If the console shows a 500 error or "memory exhausted", the library query may have died mid-request. Raise WP_MEMORY_LIMIT in wp-config.php to 256M and retest.
Test with plugins disabled
If you're still stuck, disable plugins one by one, or clone the site to staging and test there. Security and image-optimization plugins are often the culprits. Once the grid loads, a proper cleanup pass (folders, duplicates, unused media) is easier — see our FAQs for more information.
Why do images appear on my site but not in the media library?
The images render because the files are located in /wp-content/uploads/, but WordPress does not show them in the library because there are no corresponding records in the database. The media library is essentially a list of attachment rows in wp_posts plus metadata in wp_postmeta. Without these rows, no thumbnails will appear, regardless of how many files are in the folder.
FTP-uploaded files need registration
If you or a host uploaded files directly to the uploads folder via FTP, WordPress has no record of them. The fix is to register each file as an attachment. Plugins like Media Sync or Add From Server can scan the uploads directory and create the missing wp_posts entries, generating sizes and metadata as they go. It is advisable to run this on a staging site first, especially if you have a large library.
Fix attachment metadata after migration
Migrations can also cause issues: files may have moved, the database import may have skipped or truncated wp_posts, or a search-replace may have mangled the _wp_attached_file paths. Check one broken image's row in wp_posts and its wp_postmeta entries against the actual file path. Tools like WP-CLI's wp media regenerate can rebuild size metadata but only for attachments that already exist, so a missing row will remain missing. If you're also dealing with duplicates and unused media afterward, FoldRocket can assist with folders, cleanup, and renames in one pass. (We compare its image optimization against Imagify separately: here.)
It’s important to note that none of these fixes can recover metadata that was never exported. If the source database is gone, FTP registration is reconstruction, not restoration, and filenames become your only indexing method.
Why does the media library show images that are broken or missing on the live site?
When attachments exist in the library but return a 404 error on the front end, WordPress usually knows where the file should be while the server does not. Two common causes are incorrect upload paths after a migration and stale rewrite or CDN rules.
Verify upload_url_path and file paths
Check Settings → Media and confirm the uploads folder is set to the default wp-content/uploads. Then compare upload_path and upload_url_path in the wp_options table against the actual directory on the server. A site moved from staging to production may retain the old domain or path in upload_url_path, causing the library to build URLs that point to a server that no longer hosts the files. Fix these values and confirm the file physically exists at the path described by the broken image URL.
Flush rewrites and CDN config
If paths are correct, re-save Permalinks to flush rewrite rules. Then check any CDN or caching plugin: a stale mapped domain or an outdated zone URL can rewrite image sources to a dead host. Disable the rewrite, reload a broken image directly, and re-enable once URLs resolve.
For a side-by-side look at how cleanup tools handle renamed or relocated files, see here.
How do upload folder permissions or file paths break media library images?
Incorrect permissions or a moved uploads path can produce every symptom in this guide at once: blank grid cells, broken thumbnails, and images that load on the site but vanish from the library. Fix the filesystem first before blaming plugins.
Recommended permission values
WordPress expects directories to be set to 755 and files to 644, with wp-content/uploads writable by the web server user. The WordPress documentation on changing file permissions covers the chmod values and explains why 777 is a security risk, not a solution. If uploads were migrated using rsync or a migration plugin, ownership may shift to root, resulting in similar failures as incorrect permissions.
Multisite path differences
In a multisite setup, uploads are written to /wp-content/uploads/sites/{blog_id}/, so a hardcoded upload_path pointing at the base folder can hide images from subsite libraries. Check Settings → Media for any stray path values, and verify that uploads_use_yearmonth_folders matches how the files were actually stored on disk.
How do I find which plugin or theme is hiding images from the media library?
Isolate with a staging copy
Never troubleshoot on the live site. Clone it to staging, then switch to a default theme like Twenty Twenty-Four and see if the grid fills in. If it does, the theme is the culprit. If not, deactivate plugins in batches of five until the library recovers, then narrow down within that batch. The Health Check & Troubleshooting plugin simplifies this process with its troubleshooting mode, which disables plugins for your session only while visitors see the site normally.
Check recently updated plugins first
Start with the plugins you updated immediately before the grid went blank. Common offenders include image optimizers, gallery builders, and security plugins that filter attachment queries or rewrite file paths. Deactivate the most recent update first; this often resolves conflicts quickly.
How do I delete images from the media library safely when they are not displaying correctly?
When the grid is blank or broken, bulk deletion can be risky: you might delete attachments still in use or leave orphaned files on disk that the library no longer tracks. Follow this order of operations.
Back up before bulk deletion
Take a full backup of both the database and the wp-content/uploads directory first. Deleting an attachment removes its row from wp_posts, but the file remains on disk unless cleanup runs, so you need the file backup to recover either half. If a site uses a custom path set via UPLOADS or upload_url_path in wp-config.php, confirm where files actually reside before proceeding (see WordPress documentation on editing wp-config.php).
Find unused media and duplicates
Query the database for attachment IDs that do not appear in any post, then manually spot-check a sample. For larger libraries, FoldRocket can scan for unused media and duplicates and rename files safely. On multisite, bulk deletion requires extra care: each site has its own attachment table, so clean one site at a time.
How do I stop this from happening again across client sites?
Most breakage occurs due to migration shortcuts. Standardize your process: use a migration plugin that rewrites URLs and paths in the posts table and the attachment metadata, verify uploads permissions (folders 755, files 644) on every server, and run a search-replace on serialized data rather than a raw SQL dump.
Consider implementing monitoring. A monthly query for attachments whose files no longer exist can catch orphans before handover, and a duplicate check can identify the same screenshot uploaded multiple times.
Folders and cleanup tools can help here: virtual folders, unused-media scans, and bulk ALT text edits are core functions of FoldRocket, and staging copies do not consume extra seats. However, be aware that it cannot fix server-level path bugs or incorrect upload directory settings; those require the fixes outlined in earlier sections.
FAQ
Why is my WordPress media library not loading at all, just a spinner?
The grid loads through the REST API, so a stuck spinner usually indicates a failing REST or AJAX request. Check the browser console for 4xx or 5xx errors on wp-json requests, run the REST API test in Site Health, and raise WP_MEMORY_LIMIT to 256M in wp-config.php if you encounter a memory exhausted error.
Will deleting images from the media library remove them from my posts?
Deleting an attachment removes its row from the database, but the file remains on disk unless cleanup runs. Posts that referenced it will display broken images. Always back up both the database and the uploads folder first, and query for attachments still used in posts before performing any bulk deletions.
Why did my images disappear after moving my WordPress site to a new host?
Migrations often leave a stale domain or path in upload_url_path, causing the library to build URLs pointing to the old server. Check that value in wp_options against the actual directory, confirm files exist at the stored paths, and ensure the database import did not skip attachment rows in wp_posts.
How do I fix broken thumbnail images without regenerating every file?
Run regeneration only on the affected images rather than the entire library. Most tools allow you to select specific attachments, or you can use WP-CLI with a list of IDs. If the originals are missing entirely, regeneration will not help; instead, re-upload the source file and fix the attachment record.
Does this fix work the same on WordPress multisite?
Mostly, with two differences. Multisite stores uploads in /wp-content/uploads/sites/{blog_id}/, so a hardcoded upload_path pointing at the base folder can hide subsite images. Additionally, bulk cleanup requires care because each site has its own attachment table, so clean and verify one site at a time.