How to Fix WordPress Add Media Button Not Working



This content originally appeared on DEV Community and was authored by Minima Desk

How to Fix WordPress Add Media Button Not Working

Are you frustrated because the Add Media button in the classic editor of WordPress is not working? Don’t worry, we’ve got you covered! In this tutorial, we’ll show you exactly how to fix this issue and get you back to publishing your post.
👉
Start your website with Hostinger – get fast, secure hosting here
👈

Cause of the Add Media button not working

The most common reason the Add Media button doesn’t work is script conflicts in WordPress themes or plugins. When the script conflicts with another, the button stops working.

How to fix WordPress Add Media Button not working

To fix the Add Media button not working, follow these steps:
Using the File Manager or an FTP client, access the root directory of WordPress and edit the wp-config.php file.
Add the following code just before the line that says, ‘That’s all, stop editing! Happy blogging.’:
define(‘CONCATENATE_SCRIPTS’, false);
Save the changes to your wp-config.php file.
Log out of your WordPress site and clear your WordPress cache.
Log back into your WordPress admin and check if the Add Media button is working.
The above code tells WordPress to load each script individually instead of combining the requests, minimizing the chances of conflicts.
Please note that this is not a permanent solution and you should fix the conflicting scripts on your site.

Troubleshooting the cause of WordPress Add Media Button not working

To find the root of the script conflict, follow these steps:
Right-click on the classic editor and go to Inspect → Console using your browser.
The console tool will highlight script errors that can help you identify the problem.
Start by deactivating all of your plugins and check if the Add Media button is working. If it is, then one of your plugins is causing the conflict.
Reactivate the plugins individually and check the Add Media button after each activation. When you find the plugin that is responsible, contact the developer for help or find a replacement.
If the problem persists after deactivating all plugins, clear your caches and test if your theme is the cause of the Add Media button not working.
Activate a default WordPress theme and check if the problem is gone. If it works, the issue is with your theme. Contact the theme architect for support or switch to another theme.
Once you find the cause of the problem on your staging site, implement the fix on your live WordPress site.

Conclusion

Usually, the Add Media button breaks due to script conflicts on your website. The line of code added to wp-config.php that we shared earlier should work as a quick fix. We highly recommend updating your WordPress site and clearing your cache to avoid any conflicts. Now you can get back to adding media to your posts hassle-free!

👉
Start your website with Hostinger – get fast, secure hosting here
👈

🔗 Read more from MinimaDesk:

🎁 Download free premium WordPress tools from our
Starter Tools page
.

📦 Download your Free WordPress Starter Pack
📌 Originally published at MinimaDesk


This content originally appeared on DEV Community and was authored by Minima Desk