Integrations

Add CookieConsentHQ to WooCommerce

Install the CookieConsentHQ plugin from WordPress.org, enter your site key and publish your banner. It loads first in wp_head, passes visitor choices through the WP Consent API so WooCommerce and compatible extensions read them, and leaves essential cart and checkout cookies working.

Get your install codeFree plan, no card needed.
Installation type
WordPress.org plugin (cookieconsenthq)
Script position
wp_head priority -9999
Consent integration
WP Consent API (read by WooCommerce 8.5+)
Essential store cookies
Cart and session cookies stay necessary
Cookie table
[cchq_cookie_table] shortcode
Verification
Verify installation in the dashboard; free checker at /check

How do I install CookieConsentHQ on WooCommerce?

WooCommerce runs on WordPress, so you install the WordPress plugin directly from the WordPress.org directory:

  1. In WordPress admin, open Plugins, Add Plugin and search for CookieConsentHQ.
  2. Install and activate the plugin.
  3. Open Settings, CookieConsentHQ, paste your site key or script URL from the Install tab and save.

The plugin prints the banner loader through wp_head at priority -9999, with data-cfasync="false", data-no-optimize and data-no-defer attributes so Cloudflare Rocket Loader and LiteSpeed Cache do not delay it.

Which WooCommerce cookies are necessary vs optional?

WooCommerce sets a small set of first-party cookies to run the shopping cart and checkout:

  • woocommerce_cart_hash and woocommerce_items_in_cart help WooCommerce detect when cart contents change.
  • wp_woocommerce_session_* holds a unique code for each shopper so WooCommerce can find their cart data in the database.

CookieConsentHQ classifies these store cookies as necessary so shoppers can add items to their cart and check out before interacting with the banner. Marketing and analytics cookies added by store extensions, such as _ga, _fbp, _gcl_au or TikTok and Pinterest pixels, are held back until the shopper grants consent.

WooCommerce includes native support for the WP Consent API, and the CookieConsentHQ plugin publishes each visitor's choice to it automatically.

When a shopper chooses analytics or marketing preferences in the CookieConsentHQ banner, WooCommerce and any third-party extension that reads wp_has_consent() receive the updated state. For extensions that inject their own tracking script without checking the WP Consent API, CookieConsentHQ's automatic tracker blocking and Google Consent Mode v2 defaults still guard known ad and analytics hosts.

Homepage scans miss trackers that only fire on product, cart or checkout pages (for example ViewContent or AddToCart pixels). After connecting the plugin and clearing your page cache:

  1. Run Verify installation in your CookieConsentHQ dashboard to check your homepage script order and live version.
  2. Run a full multi-page scan with the cookie scanner so product and category pages are checked too.
  3. Test a product page URL in the free cookie checker to inspect cookies set before consent and Consent Mode v2 defaults.

If a page cache or theme header stops the banner from showing, see Cookie banner not showing or the installation documentation.

This page is technical installation guidance, not legal advice.

Questions

Will the banner break my WooCommerce cart or checkout?
No. Essential WooCommerce cart and session cookies (such as woocommerce_cart_hash, woocommerce_items_in_cart and wp_woocommerce_session_*) are necessary for the store to function and are not blocked by CookieConsentHQ.
Does WooCommerce read consent from the WP Consent API?
Yes. WooCommerce includes built-in WP Consent API integration. The CookieConsentHQ WordPress plugin registers visitor choices with the WP Consent API so WooCommerce and supporting extensions can respect them.
What about Facebook for WooCommerce or Google for WooCommerce pixels?
Ad and analytics plugins often inject Meta Pixel or Google tags directly into product and checkout pages. Run a scan in your dashboard or the free checker on a product page to verify no _fbp or _ga cookies are set before consent.
Do I need a separate plugin if I already installed CookieConsentHQ for WordPress?
No. WooCommerce runs on WordPress, so the same CookieConsentHQ WordPress plugin handles both your store pages and your content pages.