WordPress Tutorial

How To Fix WordPress Add Media Button Not Working

WordPress Add Media button not working

We know the frustration. You are busy preparing a post for publication, so you decide to add some media but WordPress Add Media button doesn’t work much to your chagrin.

This problem is frustrating because you don’t know what is wrong and your workflow is bearing the brunt of it all. In this post, we show you exactly how to fix Add Media button not working.

That being said, let us dive right in and wow us with your thoughts and suggestions in the comments.

Cause of The Add Media Button Not Working

add media button not workingThe most common cause of the Add Media button not working is script conflicts among your themes and plugins. JavaScript runs a lot features in the WordPress admin including the Add Media button.

When the JS script that runs the Add Media button collides with any other script, it fails to process disabling the Add Media button.

A closely related problem – the Insert into post button not working – is caused by permission errors on a folder, more so when you switch hosts, but that is a story for another day.

Now that this problem is no longer shrouded in mystery, let us troubleshoot and fix Add Media button not working in WordPress.

How to Fix WordPress Add Media Button Not Working

Using FTP or File Manager, access your WordPress root directory and open the wp-config.php file for editing.

hostinger file managerNext, add the following code to just before the line that says “That’s all, stop editing! Happy blogging.”

define('CONCATENATE_SCRIPTS', false);

Save changes to your wp-config.php file. Log out of your WordPress site and clear all of your caches i.e. browser, plugin, 3rd-party, and server cache.

Log in back to your WordPress admin and check if the Add Media button is working.

The above code simply tells WordPress to load each script individually instead of combining the requests, which is what WordPress does by default.

Loading the scripts separately minimizes the chances of running into conflicts.

While this code is your best chance of fixing the Add Media button, it is not a permanent solution since the problem indicates you have conflicting scripts on your site, something you obviously want to fix.

Troubleshooting The Cause of WordPress Add Media Button Not Working

Now let us find the root of the script conflict, so you can eliminate the problem once and for all. We recommend you do this on a staging website instead of a live website.

You can pinpoint the cause of your woes using your browser’s Inspect -> Console. The console tool highlights script errors that can help you to identify where the problem lies.

Chrome ConsoleThat aside, start by deactivating all of your plugins. Then check if the Add Media button is working. If the button is working, then it is obvious one of your plugin is causing the script conflict.

deactivating all plugins to troubleshoot wordpress add media button not working Next, reactivate the plugins one by one, and check the Add Media button after each activation. When you find the responsible plugin, contact the developer for help or find a replacement.

If the problem persists after deactivating all plugins, you need to ensure you’ve cleared your caches first and then test if your theme is the cause of the WordPress Add Media button not working.

Just activate a default WordPress theme such as Twenty Seventeen and then check if the problem is gone. If the button works, the issue here is your theme.

manage themes in wordpress adminWhat to do? Talk to the theme developer for support or change to another theme. If you know your way around code, you can even eliminate the conflict by editing your theme’s files.

When you find the cause of the problem on your staging site, you can go ahead and implement the fix on your live WordPress site.

Recap

Usually, the Add Media button breaks due to script conflict somewhere on your website. The line of code we added to wp-config.php we shared earlier should work like magic.

That aside, we recommend you update your WordPress site, so that you can get rid of old code and scripts that might cause conflicts, hence this problem.

Additionally, remember your cache might mislead you to think you have a problem, so it’s vital to clear your cache after/before trying the solution in this post.

About the author

Freddy Muriuki

Freddy is a WordPress theme reviewer at WP Theme Raves, published WordPress blogger, web dev and founder of Vista Media Enterprises, an online business dedicated to WordPress users looking to boost conversion rates via content marketing.

Add Comment

Click here to post a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Have a website?

Join thousands of webmasters who get our free newsletter with tips on how to drive more traffic and revenue to their websites!

Please wait...

Thank you for sign up!

More in WordPress Tutorial
WordPress template hierarchy
Understanding the WordPress Template Hierarchy: A Complete Guide

Close