June 18, 2018
June 18, 2018
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.
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.
Next, add the following code to just before the line that says “That’s all, stop editing! Happy blogging.”
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.
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.
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.
What 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.
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.