Skip to content

How Cloudflare's Rocket Loader Can Break WooCommerce Features (And How to Fix It)

If WooCommerce features like add-to-cart buttons or product variations stop working on the frontend, Cloudflare’s Rocket Loader is a common culprit. This guide explains why it happens and how to disable it.

  • The “Add to cart” button doesn’t respond.
  • Product variations don’t update prices.
  • Cart totals don’t change dynamically.
  • Checkout fields disappear or get stuck.
  • The browser console shows an error similar to: Refused to execute inline script because it violates the following Content Security Policy directive...

If any of this sounds familiar, the fix is usually quick.

Rocket Loader is a Cloudflare performance feature that defers and reorders JavaScript execution to speed up page loads.

WooCommerce relies on its JavaScript being loaded in a specific order and at specific times. Rocket Loader’s reordering interferes with this, which breaks key frontend functionality like add-to-cart and variation pricing.

How to disable Rocket Loader in Cloudflare

Section titled “How to disable Rocket Loader in Cloudflare”

Disabling Rocket Loader solves the issue immediately.

  1. Log into your Cloudflare dashboard.
  2. Go to Speed » Optimization.
  3. Scroll down to Rocket Loader.
  4. Disable the option and click Save.
  5. Clear your Cloudflare cache and your site’s cache (if you use a caching plugin like WP Rocket or LiteSpeed Cache).

If you’re running into multiple issues or want a clean slate for testing, the free WP Reset plugin safely resets your WordPress installation to its default state.

Gomax and its WooCommerce widgets are fully compatible with Cloudflare as long as Rocket Loader is disabled. For caching and optimization, proven options include:

  • LiteSpeed Cache
  • WP Rocket
  • Autoptimize (with manual tuning)

If you run into trouble after disabling Rocket Loader, see Getting Help and Troubleshooting. For other WooCommerce setup topics, check out How to set up WooCommerce Cart, Checkout, and My Account pages and How to set up Variation Swatches for my products in WooCommerce.