Skip to content
WordPress

WordPress Media Library Not Loading: Seven Targeted Fixes

WordPress media library not loading blocks image management and featured photo uploads. Here are all the real fixes — cache, plugin conflicts, CORS, memory limits, permissions, and REST API.

WordPress Media Library Not Loading: Seven Targeted Fixes

You navigate to the WordPress media library to find an image, add a featured photo to a post, or manage uploaded files — and the library simply will not load. The spinning wheel keeps turning, the grid stays blank, or the modal opens and immediately shows an error. WordPress media library not loading is a frustrating failure precisely because it blocks basic editorial tasks that should take seconds. The causes range from JavaScript conflicts to CORS misconfigurations and server memory limits, and each has a precise fix. You’ll find the complete rundown in our WordPress Errors Complete Guide.

WordPress Media Library Not Loading — Immediate Checks

Before diagnosing deeper causes, two immediate checks resolve the WordPress media library not loading issue in many cases without any code changes. Check the browser console for errors and clear any active caches.

Open your browser’s developer console (F12 → Console tab) and refresh the media library page. JavaScript errors appear in red and usually identify the specific script causing the failure — a plugin name, a theme file, or a WordPress core function. A “CORS policy” error means the browser is blocking the media library request due to a domain mismatch. A “Failed to fetch” or “net::ERR” error points to a network or SSL issue. A plugin-named script error immediately tells you which plugin to deactivate. These console errors are the single most efficient diagnostic tool for WordPress media library not loading and take thirty seconds to check.

Clear all caches: if you use a caching plugin (WP Rocket, W3 Total Cache, LiteSpeed Cache), navigate to the caching plugin’s settings → purge all caches. Also clear the browser’s own cache (Ctrl+Shift+Delete → All time → Cached images and files). Caching plugins sometimes serve a stale version of WordPress’s media library JavaScript files that becomes incompatible after a WordPress core update. Purging forces fresh files to load. A CDN (Cloudflare, BunnyCDN) caching the media library assets also causes this — purge the CDN cache from the CDN dashboard after purging the plugin cache. After clearing all caches, reload the media library page. Our guide on clearing WordPress cache safely covers each caching layer in detail, including CDN purge procedures relevant when cache is causing WordPress media library not loading.

Plugin and Theme Conflicts Causing the Blank Library

JavaScript conflicts from plugins and themes are the most common cause of WordPress media library not loading as a blank grid or infinite spinner. WordPress’s media library is a JavaScript-heavy interface, and a single conflicting script from a third-party plugin can break it entirely while leaving the rest of the admin functional.

Test with all plugins disabled: navigate to wp-content/plugins via FTP or File Manager → rename the plugins folder to plugins_disabled → reload the media library. If it loads correctly, a plugin conflict is confirmed. Rename the folder back to plugins → reactivate plugins one at a time, reloading the media library after each → the plugin that causes the blank library after reactivation is the conflict. Common offenders for WordPress media library not loading include gallery plugins, image optimisers, and SEO plugins that add admin scripts globally rather than only on their own pages.

Switch to a default theme to test theme conflicts as a cause of WordPress media library not loading: Appearance → Themes → activate Twenty Twenty-Four or another default WordPress theme → reload the media library. If it loads correctly, your active theme’s admin CSS or JavaScript is interfering with the media library. Check your theme’s functions.php for any code that enqueues scripts on all admin pages using the admin_enqueue_scripts hook without a proper page check. Restricting admin script loading to specific admin pages (checking $hook before enqueueing) resolves the conflict without removing the scripts entirely. If you are using a child theme, check both the child and parent theme’s functions.php. Our guide on fixing WordPress plugin conflict errors covers the systematic deactivation method that applies directly to WordPress media library not loading caused by plugin JavaScript interference.

CORS and Mixed Content Errors

WordPress media library not loading due to CORS (Cross-Origin Resource Sharing) errors is common on sites that recently migrated to HTTPS, changed domain names, or use a CDN with a different domain for assets. The browser console shows a specific CORS error when this is the cause.

Verify your WordPress URL settings — a mismatch causes WordPress media library not loading via CORS: Settings → General: Settings → General → WordPress Address (URL) and Site Address (URL). Both must be identical and must match the protocol (http vs https) that your site actually uses. A common WordPress media library not loading scenario: the site migrated to HTTPS but WordPress Address still shows http:// — WordPress then generates media library API requests to the HTTP URL while the browser is on HTTPS, which the browser blocks as a CORS violation. Update both URLs to the correct HTTPS version. Also update the siteurl and home values in the WordPress database (wp_options table) if the admin settings cannot be saved due to the URL mismatch preventing login.

Mixed content errors occur when the media library attempts to load images or assets from HTTP sources on an HTTPS page. Check the browser console for “Mixed Content” warnings alongside the library loading failure. Installing the Really Simple SSL plugin or adding the define('FORCE_SSL_ADMIN', true); line to wp-config.php ensures all admin requests use HTTPS. For sites behind a load balancer or reverse proxy (common on managed hosting), the WordPress admin may not correctly detect HTTPS — add define('HTTPS', true); and configure the correct $_SERVER['HTTPS'] detection in wp-config.php. These configuration fixes resolve WordPress media library not loading caused by SSL and CORS issues without requiring any theme or plugin changes. According to the WordPress developer documentation, the WordPress Address URL setting must exactly match the domain and protocol the browser uses to access the admin, or the REST API requests that power the media library will fail with CORS or authentication errors.

PHP Memory Limit and File Permission Fixes

The WordPress media library not loading problem sometimes has a server-side cause rather than a JavaScript or configuration cause. PHP running out of memory while loading the media library thumbnails and database queries produces a blank or errored library even when the JavaScript configuration is correct.

Increase the PHP memory limit — a direct fix for memory-caused WordPress media library not loading: edit wp-config.php and add or update this line above the “That’s all, stop editing!” comment: define('WP_MEMORY_LIMIT', '256M');. Also update the upload memory limit: define('WP_MAX_MEMORY_LIMIT', '512M');. Alternatively, edit .htaccess and add: php_value memory_limit 256M. After increasing the memory limit, reload the media library. Large media libraries with thousands of images are particularly vulnerable to memory exhaustion — each thumbnail query adds to PHP’s memory footprint. Our guide on increasing WordPress memory limit covers all three methods for raising the PHP memory allocation in detail.

File permission issues cause WordPress media library not loading by preventing PHP from reading uploaded files: WordPress requires the wp-content/uploads/ directory and all its subdirectories to have 755 permissions, and all files within it to have 644 permissions. Connect via FTP or SSH → navigate to wp-content/uploads → right-click → File Permissions → apply 755 recursively to directories and 644 to files. Incorrect permissions (common after server migrations or manual file uploads with the wrong user account) cause WordPress media library not loading by preventing PHP from reading the image files that populate the library grid.

Database and REST API Fixes for the Media Library

WordPress’s media library uses the REST API to fetch attachment data and display the grid. When the REST API is disabled or broken, the media library loads the interface shell but never populates the grid with images — showing a blank modal or an endless spinner. This is WordPress media library not loading at the API layer rather than the JavaScript or server layer.

Test the REST API: navigate to yoursite.com/wp-json/wp/v2/media in the browser. A JSON response containing your media items confirms the REST API is functioning. A 403 Forbidden or 401 Unauthorized response indicates the REST API is blocked. Common causes: a security plugin disabling REST API access for anonymous users (Disable REST API plugin, iThemes Security REST API setting), a wp-config.php constant blocking the API, or a .htaccess rule denying access to /wp-json/. Remove any REST API restrictions that affect authenticated admin users — the media library requires authenticated REST API access to function regardless of whether public REST API access is disabled. Our guide on fixing WordPress REST API errors covers every cause of blocked API access that also causes WordPress media library not loading as a direct consequence.

Database table corruption is a less common but real cause of media library failures — corrupted entries in the wp_posts or wp_postmeta tables where attachments are stored can cause the library to fail during data retrieval. Navigate to Tools → Site Health → check for any database-related warnings. Alternatively, run the WordPress database repair tool: add define('WP_ALLOW_REPAIR', true); to wp-config.php → navigate to yoursite.com/wp-admin/maint/repair.php → run “Repair and Optimize Database” → remove the define line from wp-config.php after completion. The database repair resolves table-level corruption that causes WordPress media library not loading during the attachment query phase, restoring the library without any data loss. Reviews from the WordPress community forums confirm that plugin conflicts and REST API blocks together explain the majority of WordPress media library not loading reports across all recent WordPress versions.

The .htaccess file is another common cause of WordPress media library not loading that is easy to miss — a corrupted or manually edited .htaccess can block the REST API requests or the admin-ajax.php calls that power the media library without producing an obvious error message in the browser. Navigate to your site’s root directory via FTP → download a copy of .htaccess as a backup → replace the entire file with WordPress’s default .htaccess content. The default WordPress .htaccess for a single site is: # BEGIN WordPress followed by the standard RewriteEngine block. After replacing .htaccess, reload the media library. If it loads, the previous .htaccess had a rule blocking the library’s requests. Compare the new working version with your backed-up version to identify the problematic rule and remove only that rule if you need other custom directives preserved.

Browser extensions that modify page behaviour — particularly ad blockers, privacy blockers, and script blockers — sometimes block the API calls that WordPress media library not loading depends on, especially if the extension uses an aggressive blocking list that includes WordPress REST API endpoints or admin-ajax.php as tracked URLs. Test the media library in an Incognito/Private browsing window where most extensions are disabled. If the library loads correctly in Incognito, a browser extension is the cause. Disable extensions one at a time in normal mode to identify the offending one, then add your site’s domain to that extension’s whitelist. This is a particularly common cause of WordPress media library not loading for developers who use heavy ad-blocking or script-blocking browser profiles for privacy.

The wp-config.php constant DISALLOW_FILE_EDIT and DISALLOW_FILE_MODS do not affect the media library directly, but UPLOADS constant misconfiguration does. If a custom UPLOADS constant in wp-config.php points to a directory that does not exist or uses an incorrect path format, the media library cannot locate uploaded files and fails to display them. Check wp-config.php for any custom define('UPLOADS', ...) line — if the specified path does not match the actual uploads directory location on the server, correct it or remove the custom constant to let WordPress use its default uploads path at wp-content/uploads/.

Checking the WordPress Site Health tool provides an automated overview of configuration issues that cause WordPress media library not loading: navigate to WordPress admin → Tools → Site Health → run the tests. The Site Health tool checks PHP memory limit, REST API availability, filesystem permissions, and database table status — all of the categories covered in this guide. Any issue listed under “Should be improved” or “Critical” that relates to the media library should be addressed in the order the tool presents them. The REST API test is particularly useful because it directly tests whether the media library’s data endpoint is reachable and returns the expected response.

For multisites experiencing WordPress media library not loading on subsites while the main site works, the likely cause is the subsite’s media upload directory not being created correctly. Each subsite stores uploads in wp-content/uploads/sites/[site_id]/. If this directory was not created during subsite setup or the web server does not have write permission to the sites directory, the media library loads without error but shows no images. Create the missing directory manually via FTP with 755 permissions and ensure the web server user (www-data, apache, or nginx depending on the stack) has write access to it.

Nikolas Lamprou

Nikolas Lamprou (MSc; GCFR, SC-200, Security+) has been working with computers professionally since 2009 — starting with web development and e-commerce, and moving into cybersecurity over the years. Based in Greece, he brings over 15 years of real-world IT experience to SolveTechToday, where he writes about Windows fixes, software reviews, security tools, and AI applications. His goal is straightforward: cut through the noise and give readers clear, honest guidance on the tech decisions that matter.

Stay Ahead

Fix your next problem before it starts

Get the week's best Windows fixes, software picks, and security guides delivered straight to your inbox. No noise, just solutions.

Press ESC to close · Try "Windows 11" or "Chrome"