Skip to main content
Back to Guides
Compliance5 min readBy Armin Zaribaf

WordPress Cookie Banner for CCPA/CPRA: 2026 Setup

How to give California visitors a working Do Not Sell or Share opt-out on WordPress and WooCommerce: plugin install, GPC handling, the WP Consent API, and the marketing plugins that keep firing after an opt-out.

California's privacy law doesn't ask for an opt-in cookie banner. What it asks for catches many WordPress sites off guard: a working opt-out of the sale and sharing of personal information, tags that actually stop when someone opts out, and automatic handling of the Global Privacy Control browser signal. The CPRA amendments broadened "sharing" to cover disclosing data for cross-context behavioral advertising, even without money changing hands. That's what most ad pixels do. On WordPress, the banner itself is rarely the hard part. The hard part is marketing plugins that print pixel tags from PHP without ever asking the banner for permission.

CCPA/CPRA requirements and where they live on WordPress
RequirementWhat California expectsOn WordPress
Opt-out link"Do Not Sell or Share My Personal Information", or the alternative "Your Privacy Choices" link, on every pageA menu or footer link, plus the consent tool's persistent link
Opt-out preference signalsTreat GPC as a valid opt-out of sale and sharing, with no extra clickHandled by the consent tool in the browser; plugins using the WP Consent API follow it
Sensitive dataA "Limit the Use of My Sensitive Personal Information" link if you use sensitive data beyond permitted purposesRelevant for health, location or financial plugins and forms
MinorsOpt-in before selling or sharing data of consumers you know are under 16Membership or account logic; a banner can't determine age
Re-askingWait at least 12 months before asking someone who opted out to opt back inA consent-tool setting

The plugin problem

Pixel plugins for Meta, Google, TikTok or Pinterest, WooCommerce marketing extensions and analytics plugins often inject their tags server-side. A consent tool can only stop those tags if the plugin either checks consent before printing the tag, or outputs the tag as inert markup the consent tool activates. The WP Consent API is the standard contract: plugins that support it call wp_has_consent() before adding tracking code. For every marketing plugin on your site, check whether it supports this API. If it doesn't, disable its built-in tag and load the vendor through markup or GTM that your consent tool controls.

The broader WordPress mechanics are covered in WordPress cookie consent in 2026 and, for stores, the WooCommerce setup guide.

Set up CookieBeam for California visitors

1

Publish your banner first

Create the banner in CookieBeam, set up its categories, and publish it to production so the loader has a configuration to serve. See the quickstart.

2

Install the CookieBeam plugin

Upload the CookieBeam plugin zip under Plugins › Add New Plugin › Upload Plugin (it's not in the WordPress.org directory yet), activate it, and paste your banner ID under Settings › CookieBeam. The plugin prints the loader first in <head> and prevents common optimization plugins from deferring or combining it. If you previously pasted a CookieBeam script directly into your theme, remove it so the loader doesn't fire twice. See the WordPress integration.

3

Apply the CCPA/CPRA preset

On the banner's Regional settings page, add a rule from the CCPA/CPRA framework preset. It targets California visitors with an opt-out banner in a bar-inline layout at the bottom of the page. The preferences button reads "Do Not Sell or Share My Personal Information" and opens the US opt-out panel. Turn on the rule's Do-Not-Sell link option so a persistent link remains accessible after the first choice. If you serve visitors in other US privacy states, add the US Opt-Out States preset too. See regional rules.

4

Mark the tags that sell or share

Put ad pixels and data-sharing tags in the marketing category. Hardcoded scripts need inert markup (type="text/plain" with data-category) so CookieBeam can control them; see script blocking. Under opt-out mode, these tags run by default. Once the visitor opts out, they stop being activated. An opt-out can't unload a script that already ran on the current page.

5

Keep Consent Mode on

Leave Google Consent Mode enabled in the banner settings. It updates Google's own tags, and it drives the consent-state event that CookieBeam's vendor bridges listen to.

6

Connect the WP Consent API

With the WP Consent API plugin active, CookieBeam registers as the site's consent plugin and passes the visitor's choice to wp_set_consent(). The mapping reads from the Consent Mode state the banner already resolved, so regional rules and GPC are already factored in: a California visitor who opts out, or arrives with GPC active, reads as no consent for marketing to every plugin that checks the API.

7

Add a menu link

Add a Cookie settings link through Appearance › Menus or as a custom link to #cookiebeam-settings. It opens the preferences panel. The rule's Do-Not-Sell link is the entry that opens the US opt-out panel, so keep both reachable.

8

Save, publish and test

Click Save Settings, then Publish. Rule changes don't reach visitors until you publish. Then run the California test below.

Test your WordPress site like a California visitor

  1. Open the site in a clean browser profile, from a California IP or with a geo-simulated preview, and confirm the opt-out banner appears.
  2. Exercise the opt-out for sale and sharing, reload, and check the Network tab. Advertising pixels should stop loading.
  3. In a GPC-enabled browser, confirm navigator.globalPrivacyControl is true, load the site fresh, and verify that advertising tags never fire at all, with no click required.
  4. Confirm the Do-Not-Sell link is still reachable after the initial choice.
  5. Repeat the opt-out test with each marketing plugin active, and view-source to look for pixels printed in the page that bypass the banner.

The cookie banner QA checklist covers the same checks for EU and UK visitors.

Frequently Asked Questions

Is a cookie plugin enough for CCPA on WordPress?

Only if it actually stops the tags that sell or share data after an opt-out and honors GPC. Plugins that inject pixels server-side without checking consent can bypass any banner. Test with every marketing plugin active.

What is the WP Consent API?

A WordPress plugin and standard that lets a consent tool publish the visitor's choice and lets other plugins check it with wp_has_consent(). Plugins that support it will follow the banner's decision, including a CCPA opt-out.

Does WooCommerce need a Do Not Sell link?

If the store is covered by the CCPA and its pixels or integrations share customer data for cross-context behavioral advertising, yes. Most stores running Meta or Google ad pixels are in that position.

Where should the Do Not Sell link go on WordPress?

Somewhere reachable from every page, usually the footer menu. A floating link from your consent tool covers pages that use custom templates.

WordPress cookie consent in 2026 covers the GDPR opt-in side of the same setup. For the law, read how to build a compliant Do Not Sell or Share link, Global Privacy Control explained and CPRA enforcement in 2025-2026. If you serve visitors in other US privacy states, use the US state privacy cookie banner checklist.

Primary sources: California Attorney General CCPA page, the California Privacy Protection Agency (regulations and enforcement decisions), and the Global Privacy Control specification.

This page summarizes the law as we understand it in October 2026 for website and cookie decisions. It isn't legal advice. Statutes, regulations and attorney general guidance change, so confirm the current text with counsel before relying on any threshold or date here.

7 min read

GPP, MSPA & US State Signals: A Publisher's Guide

The US Privacy String you built for CCPA was deprecated in January 2024. GPP, the US National string, and the MSPA replaced it, and getting the signal wrong can be a misrepresentation. Here's how the new US privacy signals move through the ad stack.

5 min read

Building a TCF CMP That Passes IAB Validation

What it takes for a Consent Management Platform to pass IAB Europe's TCF checks: a registered CMP ID, a cleanly decodable TC String, event-listener delivery, and encoding against the right GVL version.

9 min read

How to Migrate Your CMP Without Losing Existing Consent Records

A step-by-step technical guide to switching consent management platforms without losing consent records, triggering mass re-consent, or breaking Consent Mode. Covers export, category mapping, parallel runs, and zero-downtime migration patterns.