Back to Community

How to Fix Common JavaScript Conflicts in Autoptimize

27 threads Sep 10, 2025 PluginAutoptimize

Content

Many WordPress users rely on the Autoptimize plugin to improve their site's performance by minifying and combining JavaScript and CSS files. However, this optimization process can sometimes break the functionality of other plugins or themes. A frequent culprit is JavaScript optimization, which can cause issues with forms, calendars, payment gateways, and other interactive elements.

Why Do These Conflicts Happen?

Autoptimize works by aggregating JavaScript files and changing their loading order. Some scripts, particularly those that depend on specific libraries like jQuery or that need to load in a precise sequence, may not function correctly after this process. The result can be errors in the browser console, such as "Uncaught ReferenceError: jQuery is not defined," which prevent other features from working.

Step-by-Step Troubleshooting Guide

Follow this methodical approach to identify and resolve conflicts between Autoptimize and other plugins.

1. Identify the Problematic Optimization

The first step is to determine which type of optimization is causing the issue. In your WordPress admin dashboard, navigate to Settings → Autoptimize.

  • Disable Optimize JavaScript Code and test your site. Does the problem disappear?
  • If not, re-enable JavaScript optimization and disable Optimize CSS Code instead.
  • Continue this process with HTML and Image optimization (including lazyload) until you find the setting that resolves the conflict.

In the vast majority of cases, as seen in the support threads, the issue is traced back to JavaScript optimization.

2. Check the Browser Console for Errors

With JavaScript optimization still enabled, open your website in a browser like Google Chrome. Right-click on the page and select Inspect, then navigate to the Console tab. Look for any red error messages. Common errors include:

  • Uncaught ReferenceError: jQuery is not defined
  • Uncaught TypeError: Cannot read properties of undefined
  • 404 errors for specific .js files

These errors provide crucial clues for the next step.

3. Add JavaScript Exclusions

If the conflict is confirmed to be JavaScript-related, the solution is often to exclude the problematic script from being optimized. Go back to the Autoptimize settings and find the field labeled Exclude scripts from Autoptimize:.

Add the following exclusions one by one, testing your site after each addition:

  • js/jquery/jquery.js
  • js/jquery/jquery.min.js
  • wp-includes/js
  • wp-content/plugins/plugin-folder-name/ (Replace with the actual folder of the conflicting plugin)

For example, to fix a conflict with Contact Form 7, adding wp-includes/js, plugins/contact-form-7/ to the exclusion list has proven effective.

4. Special Case: WooCommerce Checkout Pages

A specific known issue can occur on WooCommerce checkout or cart pages. If you are experiencing problems with payment gateways like PayPal Payments not displaying, a simple fix is to disable optimization on those pages. In Autoptimize, navigate to the Misc tab and uncheck the option labeled Also optimize for logged in users?/ cart/ checkout. This often resolves payment field issues immediately.

Conclusion

Conflicts between Autoptimize and other plugins are common but usually easy to diagnose and fix. The key is to methodically disable optimization types to identify the cause and then use strategic exclusions to allow critical scripts to function normally. By following these steps, you can maintain your site's performance without sacrificing essential functionality.

If problems persist after trying these steps, consider seeking help from the specific support forums for the plugin that is experiencing the conflict, as they may have more detailed exclusion guidelines.

Related Support Threads Support