“Shared Media” Tab Returns an Error

If you’re trying to use the shared media library on your website, but for some reason, you’re getting an error like in the screenshot below, then this support article is for you.

The shared media library tab doesn't display media files

In some cases, if you check your browser console after that, you can also notice something like “Failed to load resource: the server responded with a status of 500.”

Why is it happening, and what can we do to fix this issue?

One of the other plugins you use on your website is most likely responsible for that. If you don’t have many of them, please start deactivating them one by one and see when the error will disappear.

If you don’t feel comfortable deactivating the plugins, you can try to investigate where exactly this error is coming from.

To do so, let’s activate the WordPress debug log by using the below lines in your network’s wp-config.php file:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_DISPLAY', false );
define( 'WP_DEBUG_LOG', true );

After that, you need to trigger the error one more time and then check what is inside the /wp-content/debug.log file.

For example, in my case, I noticed an error like this:

[03-Apr-2025 12:14:57 UTC] PHP Fatal error:  Uncaught TypeError: AATXT\App\Setup::altText(): Return value must be of type string, null returned in /wp-content/plugins/auto-alt-text/src/App/Setup.php:246

From the error message above, we can say for sure that the error is in an “auto-alt-text” plugin.

What to do next? There are multiple options:

Of course, you can also try to fix an error on your own. In my case, the error was fixed when I added a simple condition into the Setup.php file:

$altText = is_null( $altText ) ? '' : $altText;

But of course, everything depends on the plugin that throws an error.

Need more help?