When it comes to your website, you want to be able to add images to your website.
When the media button isn't working or is not showing on the posts or pages editing screens, then you need to find a fix.
Add Media button not working in WordPress generally happens when script conflicts among your themes and plugins.
Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to resolve related WordPress errors.
In this context, we shall look into how to fix this WordPress error.
Recently one of our customers reported that the 'Add Media' button on their WordPress site has suddenly stopped working.
This problem does not display any error or warning which leaves users clueless about why their 'Add Media' button is not working.
Let us see cause for this issue.
Generally, this issue caused by conflicting scripts or stylesheets loaded by WordPress plugins or themes installed on our site.
WordPress combines all scripts inside the WordPress admin area to improve performance and speed.
A plugin or theme's script can disrupt this which will make other code in the script stop working.
1. First and foremost, quick fix is to add the following code to wp-config.php file.
We can do this by editing wp-config.php file and adding this code just before the line that says 'That's all, stop editing! Happy blogging':
define(‘CONCATENATE_SCRIPTS’, false );
After that, visit post edit screen to see if the add media button is working as expected.
2. Secondly, an easier way to find the source of the problem is by using the inspect tool. It will show console errors which can lead to the source of the conflict.
We need to perform the basic WordPress troubleshooting tips to figure out which plugin or theme may be causing the issue.
Otherwise, take the necessary backup so that we can revert if required.
i. Initially, deactivate all WordPress plugins and then check if it fixed the 'Add Media' button. If it does, then this means one of the plugins was causing the issue.
ii. Then, activate the plugins one-by-one and after activating a plugin, check the 'Add Media' button. This will help to find out which plugin is causing the issue.
After we find the culprit plugin, we can replace it with another plugin or ask plugin author for help.
iii. If switching to the default theme fixes the issue, then this means the theme is causing the conflict.
We can ask theme author for support or switch to a different WordPress theme.
Once we find the source of the problem on staging site, then we can apply the fix on live WordPress site.