Plugins Plugin hub Backup SEO Caching Security Forms WooCommerce Images Best backup plugins
Hosting Hosting directory Shared Managed Cloud India
Themes & builders Compare Rank Math vs Yoast
Tools All tools Hosting finder Plugin stack builder Cost calculator Salt generator Theme detector Who is hosting this? Speed test Headline analyzer robots.txt generator Redirect generator Uptime calculator Blog name generator
Best lists Best backup plugins Deals
Guides All guides Speed up WordPress Choose hosting Back up WordPress
How we test

Troubleshooting · Troubleshooting

How to Fix a Media Library That Won't Load in WordPress

Short answer

Open Media > Library and switch between Grid view and List view first. If List view works, the fault is usually JavaScript, a plugin, a security rule or a failed background request. If both views fail, check Tools > Site Health, deactivate plugins, check PHP memory, and look at the browser console and server logs.

Key takeaways

  • List view working while Grid view spins points to JavaScript, a plugin, or a failed background request.
  • Tools > Site Health > Info shows media handling, upload limits, the active image editor and GD formats.
  • WordPress asks for 40M of PHP memory on a single site and 64M on multisite, with 256M for admin work.
  • WP_DEBUG_LOG writes errors to wp-content/debug.log so you can read them after the page loads.
  • Cloudflare Rocket Loader defers all JavaScript, so turn it off and retest if admin JavaScript breaks.

What does “media library won't load” mean?

It means Media > Library opens but the files never appear, the grid spins, or thumbnails stay blank.

The Media Library is the screen where you view, edit and delete files you uploaded before. WordPress.org describes it as the place to edit, view and delete media previously uploaded to your blog, with search and filtering to find files (Media Library screen).

The fault can sit in three places. Your browser may fail to run the admin JavaScript, or your server may fail to answer the request that fills the grid.

Or the files may be missing, unreadable or blocked after a move.

Note the exact symptom first. A spinning grid, an empty grid, grey thumbnails and a failed upload point to different causes.

Why does List view work when Grid view spins?

List view works when Grid view spins because List view is a plain admin table, while Grid view needs a background request and JavaScript to fill it.

WordPress.org says the Media Library gives you two views: a visual Grid View and a conventional List View, and you switch with the icons above the screen (Media Library screen).

Try this test first. Open Media > Library, click the List view icon, and see if your files appear in rows with the newest first.

If List view works, focus on the grid request. That means JavaScript, a plugin or theme, a security rule, or a failed REST API or admin-ajax request, not missing files.

If both views fail, check whether the rest of wp-admin loads and whether the front of the site still shows images.

Grid view also loads more items as you scroll. Since WordPress 7.1, infinite scrolling is the default in the grid, and you can opt out under Users > Profile with the checkbox “Disable infinite scrolling in the Media Library grid view” (as of November 2026).

What should you check in Site Health first?

Check Tools > Site Health first, because it lists critical faults, upload limits and media handling in one place.

Site Health has two tabs. The Status tab shows critical issues, recommended improvements and passed tests. The Info tab gives granular detail about themes, plugins, media and the server (Site Health screen).

Open Tools > Site Health > Status and read every critical issue. Fix those before you test plugins one by one, since a critical issue can explain the whole fault.

Then open Tools > Site Health > Info > Media Handling. It shows the active image editor, file upload status, the max size of an uploaded file, the max effective file size, and the GD formats your server supports.

WordPress.org lists the GD formats as GIF, JPEG, PNG, BMP and WebP, and the active editor is normally WP_Image_Editor_GD unless Imagick is in use (Site Health screen).

Site Health itemWhat it tells youNext step if it looks wrong
File uploadsWhether uploads are allowed at allAsk your host if uploads are disabled
Max size of an uploaded fileLargest single file you can uploadReduce the file or ask for a higher limit
Max effective file sizeSmaller of post size and upload sizeCheck both limits, not just one
Active editorGD or Imagick for image workAsk your host if the editor is missing
GD supported formatsFormats the server can handleAsk your host about a missing format

How do you read the browser console and network request?

Open the browser console while the library loads, then look for red JavaScript errors and failed network requests.

In Chrome, press Ctrl+Shift+J on Windows or Cmd+Option+J on Mac to open the console, then reload Media > Library. Chrome DevTools docs explain how to inspect console messages and the errors behind them (Chrome DevTools console docs).

A red error that names a plugin file or theme file points at that code. A red error about a blocked script points at a security header, a security plugin or a CDN setting.

Next, open the Network panel in the same DevTools window and reload the page. Look for a request to wp-admin/admin-ajax.php or a request with query-attachments in its name, and note its status code.

A 403 status often means an access or security rule blocked the request. A 500, 502 or 503 status often means a PHP or server fault, so check the server error log next.

Write down the exact error text and the file name it names.

How do you find a plugin or theme conflict?

Deactivate all plugins, test the library, then reactivate plugins one by one until the fault returns.

This is the order WordPress.org support uses for a blank library: update WordPress, the theme and all plugins, then deactivate plugins and reactivate them one by one until the issue comes back (WordPress.org support thread).

Back up your site before you start changing plugins or files. Our guide to backing up WordPress shows the steps to take first.

Go to Plugins > Installed Plugins, select all, choose Deactivate in Bulk actions, and click Apply. Then open Media > Library again.

If the library loads, reactivate one plugin at a time and test after each one. The plugin that brings the fault back is the one to update, replace or ask for support about.

If the library still fails with all plugins off, switch to a default theme under Appearance > Themes, such as Twenty Twenty-Five, and test again. If the default theme fixes it, the fault sits in your theme.

How do you fix low PHP memory for the admin area?

Raise the admin memory limit in wp-config.php, then check Site Health to see whether the new limit took effect.

WordPress asks for 40M of PHP memory on a single site and 64M on multisite by default, while the admin area asks for 256M by default. Those figures come from the WordPress wp-config documentation, which names WP_MEMORY_LIMIT and WP_MAX_MEMORY_LIMIT (wp-config.php docs).

Add the lines below near the top of wp-config.php, before the line that says “That’s all, stop editing! Happy blogging.”:

define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_MAX_MEMORY_LIMIT', '256M' );

Those lines are only a request to PHP. The PHP memory_limit set by your host is the ceiling, and WordPress docs note that some hosts do not allow raising it from wp-config.php.

If Site Health still shows the old limit after you save the file, ask your host to raise the PHP memory limit. A low limit can also cause the related allowed memory size exhausted error.

Why are thumbnails grey or missing after the grid loads?

Grey or missing thumbnails usually mean the file is gone, the image editor cannot read it, or the thumbnail was never made.

Click a grey item to open its Attachment Details dialog. WordPress.org says that dialog shows the file name, file type, file size, dimensions and the read-only file URL (Media Library screen).

Open the file URL in a new browser tab. If it returns a 404 error, the file is missing from wp-content/uploads, often after a move or a failed upload.

If the file opens but the thumbnail stays grey, check Tools > Site Health > Info > Media Handling. The active editor and the GD formats listed there show whether your server can make thumbnails from that file type.

The PHP manual lists JPEG, PNG, GIF, WebP and BMP as formats GD can read and write, with BMP support added as of PHP 7.2.0, and notes that a listed format is not proof that your build includes it (PHP GD manual).

If the same images are also broken on the front of the site, read our guide to fixing images not showing in WordPress before you delete or re-upload anything.

How can caching, a CDN or Rocket Loader block the library?

Clear every cache layer, then turn off JavaScript deferral for wp-admin and test again.

Clear the browser cache first, then your caching plugin, then any host cache, then your CDN cache. A stale cached admin page can keep showing a blank grid after the real fault is gone.

If the library still spins, pause the CDN or put it in development mode and test again. That test tells you whether the CDN or its rules sit between your browser and the grid request.

Cloudflare Rocket Loader defers all JavaScript until after the page renders. Cloudflare docs say to disable Rocket Loader and retest if you see JavaScript or jQuery issues (Rocket Loader docs).

A security plugin or firewall can also block the grid request. Turn it off briefly, test, and turn it back on.

If a cache fix helps, the same stale-cache pattern can affect the front of the site too. Our guide to changes not showing on the live site covers that case.

How do you check uploads, file sizes and REST API access?

Check the upload path in Settings > Media, the size limits in Site Health, and the REST API media endpoint in your browser.

Site Health flags a critical issue when file_uploads is set to 0, because you cannot upload files at all in that state. It also flags an active PHP session, which interferes with REST API and loopback requests (Site Health screen).

Open Tools > Site Health > Info > Media Handling and note the max upload size and the max effective file size. The effective size is the smaller of the post size and the upload size.

Try a small JPG upload under Media > Add New. If a small file works and a large file fails, the fault is a size limit, not the library itself. If no file uploads, the fault is wider.

The Media Library reads media through the REST API. The media endpoint is GET /wp/v2/media, and it returns 10 items per page by default, with source_url holding the file URL for each item (REST API Media handbook).

If that endpoint returns an error page instead of JSON when you are logged in, a security plugin, a host rule or a redirect is blocking it. Note the status code and share it with your host.

Upload errors have their own fixes too. If an upload fails with an HTTP error, see our guide to the HTTP error when uploading images.

How do you know the fix worked, and when should you contact your host?

The fix worked when Grid view loads, thumbnails show, search finds a file, and a new upload appears in the grid.

Test in this order. Reload Media > Library in Grid view and scroll down to load more items. Click a thumbnail to open Attachment Details.

Search for a file name you know. Upload a small image and check that it appears.

If the library loads for one user but not another, check that user's role. The infinite-scroll opt-out only appears for users with the upload_files capability.

Turn WP_DEBUG logging on only while you diagnose the fault. WordPress docs show WP_DEBUG_LOG writing errors to wp-content/debug.log, with WP_DEBUG_DISPLAY set to false so errors do not show on screen (Debugging in WordPress).

Read the last lines of wp-content/debug.log after you reload the library. A fatal error there names the file and line to fix or to report.

Contact your host when Site Health shows a limit you cannot change, when the error log shows a 500 error, when uploads are disabled, or when the REST API endpoint fails with all plugins off and a default theme active.

If the whole site shows a server error instead of just the library, read our guide to the 500 internal server error first, since that fault needs a different fix.

What mistakes should you avoid?

Do not delete files, edit the database or raise limits blindly before you know which part failed.

Do not delete grey thumbnails from the library before you check the file URL. Deleting the record does not bring the file back, and it can break posts that use the image.

Do not leave WP_DEBUG on with errors shown on screen. Debug mode is meant for staging or local testing, and WordPress docs warn against using it on live sites.

Do not raise the memory limit to a very high value and stop there. That can hide a plugin that uses too much memory on every admin page.

Do not test with only one browser. A browser extension can block admin JavaScript, so test in a private window with extensions off before you change the site.

Do not skip the backup step. Plugin, theme and wp-config.php changes can break wp-admin, and a backup is the fastest way back.

Frequently asked questions

Why is my WordPress Media Library blank but my images still show on the site?

The front of the site reads image files directly, while the Grid view needs JavaScript and a background request to list them. A plugin conflict, a blocked REST API request, a JavaScript error or a CDN rule can stop that request without touching the files. Test List view first, then check the browser console and Site Health.

Can a plugin break the Media Library even if it has nothing to do with images?

Yes. Any plugin that loads JavaScript or PHP in wp-admin can break the grid if it throws an error, changes the REST API response, or blocks admin requests. Media, security, caching and optimisation plugins are common causes, but any plugin can be the cause. Deactivate all plugins and reactivate them one by one to find it.

How much PHP memory does the Media Library need?

WordPress asks for 40M on a single site and 64M on multisite by default, with 256M for admin work. A media-heavy admin area with many plugins can need the full 256M admin limit. Check the value in Tools, Site Health, Info, Server, and ask your host if the limit does not change after you edit wp-config.php.

Does clearing the cache fix a Media Library that will not load?

It can fix the fault when a stale cached admin page or a cached JavaScript file is the cause. Clear the browser cache, the caching plugin, the host cache and the CDN cache, then reload the library. If it still spins, the cause is more likely a plugin, a theme, memory, a security rule or a failed background request.

Should I regenerate thumbnails to fix grey images in the library?

Only after you confirm the original files exist and open from their file URLs. If the original file is missing, new thumbnails cannot be made from it. If the file opens but the thumbnail is grey, check the image editor and GD formats in Site Health first, then regenerate thumbnails for the affected files.

When should I contact my host about the Media Library?

Contact your host when uploads are disabled, when the PHP memory or upload limit cannot be raised, when the server error log shows a 500 error, or when the REST API media endpoint fails with all plugins off and a default theme active. Share the exact error, the time it happened, and the steps you already tried.

Sources

  1. Media Library screen WordPress.org
  2. Site Health screen WordPress.org
  3. Debugging in WordPress WordPress.org
  4. Media - REST API Handbook WordPress Developer Resources
  5. wp-config.php WordPress Developer Resources
  6. Rocket Loader Cloudflare Docs
  7. Understand console messages Chrome for Developers
  8. PHP: GD - Manual PHP.net

Is your product missing, or something out of date?

Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.

About the editors

WPLegible editors

Researched from the primary sources listed above and checked against our editorial rules. About the site · How we test