WordPress Add Media Button Not Working and How to Fix It
parallax background

WordPress Add Media Button Not Working and How to Fix It

Elementor vs Beaver Builder vs BeBuilder: Which is better?
March 25, 2023
WordPress Can’t Upload Images? Here’s How to Fix It
March 28, 2023
Elementor vs Beaver Builder vs BeBuilder: Which is better?
March 25, 2023
WordPress Can’t Upload Images? Here’s How to Fix It
March 28, 2023
 

Creating attractive digital content includes using media. Images, GIFs, and videos stimulate interest and improve user experience on the site. This in turn leads to more purchases and conversions.

Media play an important role in driving more traffic to the website and improving its SEO ranking.

Working in WordPress isn't always trouble-free. Some users have experienced problems with uploading media on their site. They run into an error message which doesn’t include an explanation of what exactly caused the issue.

The WordPress add media button not working error can be frustrating. At first, it may not be clear how to fix it.

This article presents some possible sources of this error and tips on how to remove it.

Why the WordPress Add Media Button Not Working Error Occurs

 

The WordPress post editor uses JavaScript for all screen buttons, including the Add Media. Sometimes the JavaScript conflicts with other scripts or stylesheets, such as custom scripts, plugins, and themes.

WordPress is set by default to load all plugins and themes installed on the site at the same time. It combines all the requests to enhance the speed and the performance of the website.

However, when the JavaScript that runs the Add Media button conflicts with another script, the Add Media button stops working.

This is usually the root cause of the Add Media button not working error.

There is a similar error that occurs during content upload. It's the Insert into post button not working error. This malfunction is caused by permission errors on a folder.

Here are some tips on how to fix the Add Media button not working.

A Temporary Fix

The previous section explained that the error occurs when there is a collision between some scripts that are loading at the same time. So a quick, but temporary, fix is to process one request at a time. This momentary solution will enable the Add Media button to complete the content upload.

Adding a line of code to the wp-config.php file will disable the combined loading of many scripts. Instead, they will be processed individually.

Here are the individual steps:

1. Go to the cPanel and open the File Manager.

 

2. In the public_html directory find the wp-config.php file.

3. Create a backup of the original file before making any modifications.

4. Right-click on the wp-config.php file and click on "Edit".

 

5. A new window will open. If you have already secured your files by creating a backup, click on "Edit".

 

6. In the code, scroll down to the bottom. Above the “/* That’s all, stop editing! Happy blogging. */” line, copy and paste the following code:

define(‘CONCATENATE_SCRIPTS’, false );

7. Click on "Save Changes".

 

8. Try the Add Media button again.

This technique should fix the problem of colliding requests. Each script will be loaded separately and the Add Media button will work again. But the speed and performance of the site will be lower.

A more definite solution is to identify the script that is causing the Add Media button not working error.

A Long-term Fix

To remove the error completely, it's necessary to identify the script that is causing the conflict.

Every site uses many different plugins and custom scripts. These can include added search boxes, shopping carts, or discussion boards. Some premium themes also use their own built-in plugins.

 

To check which script is causing the issue, you can use the inspect tool in your browser. The Console in the Developer tools can perform an inspection and find the error.

To verify if the root cause is a plugin, you can deactivate all your WordPress plugins. Make sure to perform the process on your offline website.

1. Go to the WordPress Dashboard.

2. Navigate to the Plugins option in the menu on the left side.

 

3. Deactivate the plugins.

4. Try the Add Media button. If it works, it means that one of the plugins was the source of the error.

5. Activate the plugins one by one. After each activation check if the Add Media button is working until you find the faulty plugin.

 

6. Contact the plugin developer for technical support or replace the plugin.

 

If this didn't resolve the problem, clear your caches.

 

The active theme could also be the cause of the error. To check it, switch to a default WordPress theme or one that doesn't use any built-in plugins. A problem with a theme can be resolved by replacing it or contacting the theme developer.

After identifying the script problem on the offline site, you can fix it on the live WordPress site.

Removing Add Media For Non-Admins

 

In order to manage who uses the Add Media button, it's possible to remove the permission from the non-admins.

To hide the Add Media button, add the following code to the functions.php file:

<br />function RemoveAddMediaButtonsForNonAdmins(){<br />if ( !current_user_can( ‘manage_options’ ) ) {<br />remove_action( ‘media_buttons’, ‘media_buttons’ );<br />}<br />}<br />add_action(‘admin_head’, ‘RemoveAddMediaButtonsForNonAdmins’);<br />

Editors can have permission to edit pages. To do that, you can change the 'manage_options' in the code to 'edit pages'.

FAQ about the WordPress add media button not working error

Why is my "Add Media" button not working in WordPress?

The "Add Media" button might not work for a number of reasons, such as a conflict between plugins, an old version of WordPress, a corrupt file, or problems with how the server is set up.

How can I fix the "Add Media" button not working in WordPress?

First, try clearing the cache and cookies from your browser. If that doesn't work, turn off all plugins and use a default WordPress theme to see if the problem goes away. You could also try increasing the amount of memory PHP can use, or you could ask your hosting company for help.

What could be the reason for the "Add Media" button not working in WordPress?

Some of the most common ones are plugin conflicts, old software, and server problems. The button might also not work if there are problems with file permissions, browser settings, or the code of the website.

How can I troubleshoot the "Add Media" button not working in WordPress?

Some ways to fix a problem are to clear the cache and cookies, turn off plugins, increase PHP's memory limit, use the default theme, and check for server errors. You could also try to upload media files using FTP or ask your hosting company for help.

What should I do if the "Add Media" button is not working in WordPress after an update?

You can try turning off plugins and using the default theme to see if the update broke something. You may also need to roll back to the previous version of WordPress or contact the plugin/theme developer for updates.

How do I restore the "Add Media" button in WordPress?

You can try to fix the problem by doing things like clearing the cache and cookies, turning off plugins, and switching to the default theme. If that doesn't work, try reinstalling WordPress or restoring a backup of your website from before the problem happened.

Can a plugin cause the "Add Media" button to stop working in WordPress?

Yes, a plugin can cause problems that could make the "Add Media" button stop working. Try turning off plugins to see if the problem goes away. If it does, you can figure out which plugin is causing the problem and either fix it or find a different one.

Is there a way to bypass the "Add Media" button not working in WordPress?

You can use FTP or a file manager to add media files directly to the media library. But this method may require technical skills and doesn't fix the problem with the "Add Media" button.

How can I upload media files to WordPress if the "Add Media" button is not working?

You can use FTP, a file manager, or a plugin that lets you upload media files to try to upload files. You can also fix the problem with the "Add Media" button by following the steps above.

Does clearing the cache and cookies help fix the "Add Media" button not working in WordPress?

Yes, clearing the cache and cookies can fix temporary problems with the "Add Media" button. This is especially true if the browser settings aren't compatible or if the information is out of date.

Ending thoughts on WordPress add media button not working error

When the Add Media button is not working, WordPress users can't upload images and videos on their site. This can affect not only the user experience and traffic on the page, but also the site's SEO ranking.

There are two ways of fixing the error- temporarily by adding a line of a code to wp-config.php. This step will prevent a conflict between scripts that are loading simultaneously. Instead, the requests will be processed one at a time.

The limitation of the short-term solution is that it doesn’t remove the cause of the Add media button not working error. Also, loading scripts one by one negatively affects the speed and performance of the site.

The long-term solution is necessary in order to avoid the same issue in the future. It requires identifying the faulty script that triggers the error. Checking the custom scripts, plugins and themes will most likely pinpoint the root cause.

Finally, making sure that the site's cache is clear and removing old code and script should resolve the problem.

If you enjoyed reading this article on WordPress add media button not working error, you should check out this one about Wordpress mixed content errors.

We also wrote about a few related subjects like failed to open stream error, WordPress post missed schedule, failed to load resource error, WordPress posting to Facebook done automatically, how to reorder pages in WordPress and WordPress updating failed error.

Albert Ślusarczyk
Albert Ślusarczyk
As the co-creator of Be Theme, I am a strong believer in designing with care and patience. I pour my energy, time & knowledge into perfecting the theme for our 260,000+ customers.