CookieRay for WordPress
A self-hosted cookie consent plugin that runs inside your WordPress site. Consent logs, your cookie inventory and scan results stay in your own database — there is no external dashboard and no telemetry.
Start here
CookieRay is a plugin you install inside your own WordPress admin. There is no account to create and nothing to log in to on this site.
- Get the plugin. In your WordPress admin, go to Plugins → Add New and search for CookieRay — or download it from wordpress.org/plugins/cookieray.
- Install and activate it. Click Install Now, then Activate.
- Open it. A new CookieRay item appears in the left-hand WordPress admin menu. It opens on the Dashboard, whose checklist walks you through setup.
- Turn the banner on. It is off until you switch on Settings → Banner Display → Show Cookie Consent Banner. The Quick start covers the rest.
No WordPress site? Use the CookieRay Web App instead — it works on any website with one script tag.
Overview
CookieRay gives you the tools commonly needed for GDPR, CCPA and ePrivacy consent workflows directly inside WordPress:
- A consent banner with card and bar layouts, nine positions, a live preview and four consent categories.
- Script blocking with two modes, Log Only and Strict.
- Google Consent Mode v2 signals for the Google tags already on your site.
- A cookie scanner and a cookie inventory to discover and document what your site sets.
- Consent logs with CSV export and per-record PDF receipts.
- A Dashboard with a setup checklist, a score, scan history and settings.
The free plugin on WordPress.org includes everything above. CookieRay Pro is an optional add-on that needs the free plugin and adds geo targeting, scheduled scans, GTM / Meta Pixel / Adobe integrations, a trust badge and custom CSS.
| Where data lives | |
|---|---|
| Consent logs | A table in your WordPress database. |
| Cookie inventory and scans | Tables in your WordPress database. |
| Telemetry | None. The plugin sends no usage data or visitor data to CookieRay servers. Only the Pro add-on contacts the licence server, for licence checks and updates. |
The four categories
| Category | Used for |
|---|---|
| Necessary | Cookies the site needs to work. Always on. |
| Analytical | Measuring traffic and usage. |
| Functional | Enhanced features and personalisation. |
| Marketing | Advertising and tracking across sites. |
CookieRay helps you block scripts, collect consent, categorise cookies and keep records. It does not provide legal advice or guarantee compliance — that depends on how you configure it and on your own legal obligations.
Want several sites in one dashboard, real-browser scans and a hosted audit trail? CookieRay Web App also runs on WordPress with one script tag.
Install the plugin
- In WordPress, go to Plugins → Add New, search for CookieRay and click Install Now — or upload the
cookierayfolder so it sits at/wp-content/plugins/cookieray/. - Go to Plugins, find CookieRay and click Activate.
- CookieRay takes you to its Dashboard (bulk and network activation skip this redirect). Follow the checklist there — the Quick start covers the same steps.
| Requirement | |
|---|---|
| WordPress | 6.2 or later (tested up to 7.1) |
| PHP | 7.4 or later (tested with 8.4) |
| Multisite | Not supported in this release — use it on single-site installs. |
The banner is off by default. If you switch to Block Until Consent before enabling the banner, known trackers are held back with no banner for visitors to consent with. Enable the banner first, under Settings → Banner Display.
Quick start
From a fresh install to a working consent setup. Do the steps in order — the Dashboard checklist mirrors them.
- Choose a blocking mode. In Settings → Consent Behavior, pick Log Consent Only (scripts keep running, consent is recorded) or Block Until Consent (known trackers wait for the matching category). See Script blocking.
- Design and enable the banner. In Banner Design, choose a card or bar layout and one of nine positions, using the live preview. Then go to Settings → Banner Display and switch on Show Cookie Consent Banner.
- Run a cookie scan. Click Start New Scan on the Dashboard or Scan Now in Scan History. Results fill your Cookie Inventory.
- Categorise your cookies. Many arrive already categorised from CookieRay's reference data; review the rest in Cookie Inventory.
- Check Google Consent Mode v2. It is on by default on new installs. If you use Google Analytics or Ads, confirm it is on in Settings.
Then open the Dashboard to confirm your checklist and review your score.
Dashboard score
The Dashboard shows a Compliance Checklist and a Compliance Score. The score is the share of seven fixed, equally weighted checks that pass:
| Check | Passes when |
|---|---|
| Consent banner is enabled | The banner is switched on in Settings. |
| Consent mode set to Strict | Settings → Consent Behavior is Block Until Consent. |
| All cookies categorized | The inventory has at least one cookie and none are uncategorised. An empty inventory does not pass. |
| Privacy policy link configured | The banner shows a privacy link with a real URL — empty or a bare # does not count. |
| Scan run within the last 30 days | Your latest completed scan is no more than 30 days old. |
| Consent expiry of 13 months or less | Consent expiry is 395 days or fewer. |
| Google Consent Mode v2 enabled | The toggle is on in Settings. |
The score is internal guidance to help you spot gaps. It is not a compliance certification.
Cookie banner
Edit the banner in Banner Design with a live preview — no code.
| Panel | What you set |
|---|---|
| Banner Content | Headline, description and an optional privacy policy link (link text and URL). |
| Visual Style | Layout (Card or Bar), primary, accent and text colours, corner radius (Sharp, Rounded or Pill). |
| Buttons | Accept, Decline and Preferences text; switches to show or hide Decline and Preferences. |
| Positioning | One of nine positions, and an optional overlay background. |
| Cookie Categories | Title and description of each category in the Preferences panel. |
| Advanced | Custom CSS (Pro) — see Trust badge and custom CSS. |
A bar runs edge to edge at top-centre and bottom-centre, and is narrower at the other positions.
Visitor choices
Accept All grants every category, Decline All refuses all non-essential ones, and Preferences opens a modal with Cancel and Save preferences. Necessary is locked on; the others are opt-in. The choice is kept in the cookieray_consent cookie.
Reopening cookie settings
Switch on Settings → Banner Display → Show Floating Cookie Settings Button. If you leave it off, add a "Cookie Settings" link to your footer or privacy policy.
When visitors are asked again
- Changing the headline, description, any button text or the privacy policy URL creates a new banner version, so earlier consent no longer counts.
- Changing colours, link text or category descriptions does not re-ask.
- Visitors are also asked again when their consent passes the expiry under Settings → Consent Expiration.
The banner follows your site's text direction, so right-to-left languages are supported.
Script blocking
Choose the mode under Settings → Consent Behavior. In the admin the two options are labelled Log Consent Only (Log Only) and Block Until Consent (Strict).
| Mode | What it does | When to use |
|---|---|---|
| Log Only | Records consent without blocking. Still removes known tracking cookies for categories the visitor has not accepted. | Your integrations enforce consent themselves, or you want to observe first. |
| Strict | Delays known trackers until the visitor allows their category. | You want CookieRay to enforce blocking before consent. |
In Log Only mode CookieRay keeps the record but does not stand between the visitor and the scripts. Make sure your third-party tools respect consent on their own.
What Strict recognises
Built-in patterns cover common trackers such as Google Analytics and Tag Manager, Google Ads, Meta Pixel, Hotjar, HubSpot, TikTok Pixel, LinkedIn, Microsoft Clarity, Pinterest, Snapchat, Reddit, Segment, Mixpanel, Amplitude and Intercom. Strict works on external scripts — a src that matches a pattern, including scripts added to the page later. An inline snippet is held only if it loads one of those scripts, or if you mark it yourself. You can also add a Script pattern to a cookie in the Cookie inventory.
Block a script yourself
For a script CookieRay doesn't recognise, change its type to text/plain and name its category in data-cookieray-category:
<!-- Inline script held until Marketing consent -->
<script type="text/plain" data-cookieray-category="marketing">
// your tracking code here
</script>
For an external file, put the address in data-cookieray-src instead of src:
<script type="text/plain"
data-cookieray-category="analytical"
data-cookieray-src="https://example.com/tracker.js"></script>
Use analytical, functional or marketing. When the visitor allows that category, CookieRay restores and runs the script. This works in Strict mode only — in Log Only, marked scripts stay inert.
Uncategorised cookies
Cookies still uncategorised in your inventory are blocked by default. Under Settings → Uncategorized Cookie Handling choose Always Block Uncategorized Cookies or Treat Uncategorized Cookies as Marketing.
Google Consent Mode v2
When Enable Google Consent Mode v2 is on in Settings (the default on new installs), CookieRay outputs consent signals in the browser for Google tags you have already placed on your site — GA4, Google Ads and Tag Manager. It does not install Google tags and makes no server-side calls to Google.
| Signal | Default | Granted when the visitor allows |
|---|---|---|
analytics_storage | denied | Analytical |
ad_storage, ad_user_data, ad_personalization | denied | Marketing |
personalization_storage | denied | Functional |
functionality_storage, security_storage | granted | Necessary — always |
CookieRay also sets wait_for_update to 500 ms so Google tags give the banner a moment to report a stored choice. If a theme or plugin pushes a "granted" update before the visitor has chosen, CookieRay holds it back.
- Signals are output only on pages where CookieRay loads — the banner must be on, and the page must not be excluded by a filter or by Geo targeting.
- In Strict mode, known Google scripts are also held until the matching category is allowed. In Log Only, Google tags load straight away and rely on Consent Mode to limit what they do.
To check it works, see Verify Consent Mode.
Cookie scanner
Start a scan from the Dashboard (Start New Scan), Scan History (Scan Now) or Cookie Inventory → Bulk Actions → Run new scan. Background processing finishes the run, and past scans appear in Scan History.
What it requests
CookieRay fetches public URLs on your own domain through the WordPress HTTP API:
- Your home page, published posts, pages and other public content types.
- WooCommerce shop, cart, checkout and account pages, when WooCommerce is active.
- The login page, and the registration page if registration is on.
- Up to 100 URLs from your XML sitemap.
A deeper script-discovery pass then analyses the HTML of up to 50 URLs (from your sitemap, or the home page plus recent posts and pages). CookieRay also loads your home page in a hidden frame in your own admin browser to catch cookies and storage a server request can't see.
Cookies found are merged into your inventory and matched against bundled reference data — no external service is called.
Coverage
A scan sees what an anonymous visitor can reach. Pages behind a login, and caches that still serve stored copies, limit what it finds.
The free plugin never scans on its own — you start each scan. Scheduled scans are a Pro feature.
Cookie inventory
View, edit and categorise every cookie CookieRay knows about. A cookie without a category shows as Uncategorized.
- Edit a cookie's details and category.
- Delete cookies, or use Bulk Actions to delete selected, all uncategorised, or all cookies.
- Manual Add a cookie the scanner didn't find. Turn on Match name as regex so one entry covers a family of names, and use Script pattern to add a script address Strict mode should hold.
Categories you set by hand are reapplied after later scans while Reuse Saved Cookie Categories is on in Settings.
Consent logs
Each consent event stores an ID, the status (Accepted All, Rejected All or Custom Selection), the granted categories, the visitor's country when your host provides one, the page URL, the time and the banner version.
- Search by consent ID, user ID or page URL; filter by From / To date and consent type.
- Export as CSV downloads up to 500 of the most recent matching records (date and time in UTC, user ID, consent ID, status, categories, country, page URL). Narrow the dates and export again for older records.
- Download PDF receipt for one record — generated in your browser.
Retention
Set Settings → Consent Storage → Storage Duration (30–3650 days, default 365). A WP-Cron job deletes older records whenever WP-Cron runs on your host.
Identifiers
Raw IP addresses are never stored. CookieRay keeps a one-way SHA-256 hash of the IP and user agent — pseudonymous, not anonymous, so mention it in your privacy notice — and only a 16-character hash prefix of the user agent.
CCPA “Do Not Sell” link
For visitors detected in the US, CookieRay shows a small "Do Not Sell or Share My Personal Information" link at the bottom centre of the page — after they have answered the banner, and on later visits.
One click records a Rejected All consent, deletes known tracking cookies for the declined categories, updates Consent Mode to denied, and shows "✓ Opt-out recorded". Necessary cookies are not affected. The page is not reloaded, so a script that already ran keeps running until the next page.
- Needs a country header from your host or CDN (for example Cloudflare's
CF-IPCountry) or the PHP GeoIP extension. With none, the link is not shown. - If a page cache serves the same HTML to everyone, the link can appear for the wrong visitors — vary the cache by country.
- Change the text with the
cookieray_frontend_configfilter (banner.ccpaText); style it with.cookieray-ccpa-link.
Pro features and licences
CookieRay Pro is a separate add-on. It does not replace the free plugin — it plugs into it and unlocks extra panels in the same admin.
| Feature | What it does | Where |
|---|---|---|
| Geo targeting | Hide the banner for visitors from countries you choose. | Settings → Geo Targeting |
| Scheduled scans | Run the scanner daily, weekly or monthly. | Scan History → Schedule Scan |
| Integrations | Google Tag Manager, Meta Pixel and Adobe with consent-aware loading. | Settings → Integrations |
| Trust badge | A badge with your own text, position and style. | Settings → Trust Badge |
| Custom CSS | Your own CSS on the live banner. | Banner Design → Advanced |
| Licence | Price | Websites | Updates |
|---|---|---|---|
| Free | $0 | Unlimited | — |
| Pro · 1 Site | $49 per year | 1 | 1 year |
| Pro · 5 Sites | $179 per year | 5 | 1 year |
| Pro · Lifetime | $199 once | 25 | Lifetime |
A site is one production WordPress install; local development and staging do not count. The Pro add-on needs WordPress 6.0+ and PHP 7.4+ (the free plugin needs 6.2+), and custom CSS needs free CookieRay 1.0.2 or later. See Pro prices
Activate your licence
- Install and activate the free CookieRay plugin.
- Upload
cookieray-profrom Plugins → Add New → Upload Plugin and activate it. WordPress takes you to the licence screen. - Open the License screen under CookieRay (labelled Upgrade to Pro until a licence is active).
- Enter your License Key and the Email Address you used at purchase, then click Activate License.
The page then shows License Active, the masked key, Expires and Support Until. Click Deactivate License before moving Pro to another site.
When the licence isn't active
Pro panels stay visible but locked. Geo rules stop applying, CookieRay stops adding the GTM / Meta Pixel / Adobe tags, the trust badge disappears and scheduled scans pause. The free features keep working, and custom CSS you already saved keeps applying — you just can't edit it.
- An upgrade prompt shows instead of a key field: the Pro add-on isn't active.
- Activate License is greyed out: both the key and the email must be filled in.
- Activation fails: check the key and purchase email match exactly.
Geo targeting
Choose countries where the banner should not appear. Whether a banner is required for an audience is a legal decision — check with your adviser first.
- Open Settings and find the Geo Targeting card.
- In Hide banner from these countries, search for and select countries.
- Click Save Rules.
With no rules, everyone sees the banner. If the visitor's country can't be detected, the banner is shown — geo targeting never hides it on a guess.
What "hidden" means
No banner, no consent logged, no Consent Mode signals, and no browser-side blocker or custom CSS. Some things still run on the server:
- In Strict mode, trackers WordPress enqueues stay blocked — with no banner nothing unblocks them.
- Pro integration tags and the trust badge are still printed.
- In Log Only, nothing is blocked, so trackers run with no consent signals.
Your host must send a country
CookieRay calls no geolocation service; it reads one of these:
| Source | Header / variable |
|---|---|
| Cloudflare | CF-IPCountry |
| AWS CloudFront | CloudFront-Viewer-Country |
| Generic proxy or load balancer | X-Country-Code |
| nginx / HAProxy | X-Geo-Country |
| Apache mod_geoip | GEOIP_COUNTRY_CODE |
| Apache mod_maxminddb | MM_COUNTRY_CODE |
| PHP GeoIP extension | A local lookup, when installed |
The decision is made when the page is built. A page cache that serves the same HTML to everyone can leak one country's result to others — vary the cache by country, and test from more than one country.
Scheduled scans
Turn it on in either place:
- Scan History → Schedule Scan — switch on Enable scheduled scanning, choose a frequency, click Update Schedule.
- Settings → Automated Cookie Scans — switch on Enable Scheduled Scans, choose a Scan Frequency, click Save Configuration.
Frequencies are Daily, Weekly (default) and Monthly (every 30 days). The first run is about an hour after you turn it on. To change the frequency, switch scheduling off, save, then on again with the new one.
- Runs on WP-Cron, so on low-traffic sites or hosts that disable WP-Cron, timing can drift unless a real server cron triggers it.
- A run is skipped if the latest scan finished within the last 24 hours.
- Scheduled scans appear in Scan History as Automated; yours are Manual.
GTM, Meta Pixel and Adobe
Pro adds these tools to your page head and ties each to the visitor's consent. Open Settings → Integrations, switch on a tool, fill in its IDs and click Save Integrations. A tool outputs code only when it is switched on and its IDs are filled in.
| Tool | Fields | Strict mode | Log Only |
|---|---|---|---|
| Google Tag Manager | Container ID (GTM-XXXXXXX) | dataLayer created at once; gtm.js waits for Analytical consent. | Loads immediately. |
| Meta Pixel | Pixel ID | Loads with consent revoked (fbq('consent','revoke') before init); granted only with Marketing consent. | |
| Adobe (card labelled Adobe Analytics) | Organization ID and Datastream ID — both required | Web SDK held until Analytical consent; events queue as pending. | Loads at once, consent pending until a choice. |
GTM consent event
On every choice, and on every page for a returning visitor, CookieRay pushes this to the dataLayer:
{
event: 'cookieray_consent_update',
analytics_storage: 'granted', // or 'denied' — Analytical
ad_storage: 'denied' // or 'granted' — Marketing
}
In GTM, create a Custom Event trigger on cookieray_consent_update and read the values through Data Layer Variables. In Strict mode GTM loads after consent, so page-view triggers may not fire on that first page — use the custom event for tags that need consent.
Adobe consent
CookieRay calls alloy('setConsent', …) with in when Analytical is allowed and out when it is not.
Don't load a tag twice. If your theme, another plugin or hard-coded code already adds the same container, pixel or SDK, remove that copy or leave the integration off. And turn the banner on first: with the banner off or hidden by geo targeting, the tags are still printed but never receive consent — in Strict mode GTM and Adobe never load, and the pixel stays revoked.
Trust badge and custom CSS
Trust badge
Set it up under Settings → Trust Badge. It shows only while the banner is enabled, and it is a display badge — not clickable.
| Option | Choices |
|---|---|
| Show trust badge on frontend | On / off |
| Badge Text | Up to 60 characters. Blank uses "Privacy Protected". |
| Position | Bottom Left, Bottom Right, Bottom Center |
| Style | Minimal (text only) or Full (shield and text) |
The floating cookie settings button also sits bottom-left and can cover the badge — pick another badge position.
Custom CSS
Open Banner Design → Advanced. Up to 5,000 characters, applied on the live site only — the admin preview doesn't show it. Your CSS loads before CookieRay's stylesheet and many values are inline, so start selectors with .cookieray-banner-root and use !important:
/* Use your site font */
.cookieray-banner-root,
.cookieray-prefs-root { font-family: inherit !important; }
/* Accept button colour */
.cookieray-banner-root .cookieray-btn-primary.cookieray-btn.cookieray-btn {
background: #0f766e !important;
color: #ffffff !important;
}
/* Move the floating button above a chat widget */
.cookieray-manage-pill { bottom: 90px !important; }
| Class | Element |
|---|---|
.cookieray-banner | The banner box (plus .cookieray-layout-card / -bar and .cookieray-pos-*) |
.cookieray-headline, .cookieray-desc | Headline and description |
.cookieray-privacy-link | Privacy policy link |
.cookieray-btn-primary / -outline / -ghost | Accept / Decline / Settings buttons |
.cookieray-icon-tile | The cookie icon |
.cookieray-prefs-modal | Preferences modal (wrapper .cookieray-prefs-root) |
.cookieray-manage-pill | Floating cookie settings button |
.cookieray-ccpa-link | Do Not Sell link |
Clear your caching or CSS-optimisation plugin after saving. Class names can change between versions — inspect the banner if a rule stops working. Your browser’s developer tools (right-click the banner, then Inspect) show the current class names.
Block Google Analytics and Meta Pixel until consent
- In Settings → Consent Behavior, choose Block Until Consent and save.
- Run a scan and categorise cookies in Cookie Inventory.
- Turn on Show Cookie Consent Banner.
- Open your site in a private window with developer tools → Network, filtered for
google-analytics,googletagmanagerorfacebook. Before you click the banner there should be no requests. - Click Accept All — the requests appear. Repeat with Decline — they don't.
If something still loads early: another plugin or the theme may print the script in a way that bypasses the gate, or a page cache is serving old HTML. Compare Log Only and Strict, disable overlapping consent plugins, and clear caches. For scripts CookieRay doesn't recognise, mark them yourself.
Verify Consent Mode with GA4 and GTM
- Make sure your Google tag is already on the site and Enable Google Consent Mode v2 is on in the Google Consent Mode v2 card, with the banner enabled.
- Open your site in a private window and type
dataLayerin the console. You should see aconsentdefaultentry with denied values. - Click Accept All. A
consentupdateentry follows with granted values. - Repeat with Decline — values stay denied. Optionally confirm in Google's Tag Assistant.
How GA4, Ads or GTM behave while consent is denied depends on your Google account and tag setup, not on CookieRay.
Export consent logs for an audit
- Open CookieRay → Consent Logs and filter by From / To, Consent type or Search ID or URL.
- Click the eye icon to see a record, or the PDF icon for its receipt.
- Click Export as CSV (up to 500 records per export — narrow the dates for older ones). Settings → Data Portability Export uses the same export.
Retention (Settings → Consent Storage) is how long records are kept on your server. It is separate from Consent Expiration, which controls when a visitor is asked again. Export anything you need to keep longer than the retention period.
Switch from another consent plugin
Two consent plugins on one site show duplicate banners and fight over blocking, so switch in this order — on a staging copy first if you can.
- Note your current categories, banner text and privacy policy URL, and export the old plugin's consent logs.
- Install and activate CookieRay, leaving the old plugin on. The banner is off by default, so visitors see no change.
- Choose Log Consent Only while you set up. Recreate your banner in Banner Design, with Show privacy policy link on and a real Privacy Policy URL.
- Run a scan, categorise cookies, and optionally enable Consent Mode v2.
- In one maintenance window: deactivate the old plugin, then switch on Show Cookie Consent Banner.
- Switch to Block Until Consent and test it. Clear page and CDN caches.
- Once everything works, delete the old plugin.
Returning visitors will see the banner again, because CookieRay keeps its own consent record.
Hide the banner on specific pages
For pages that load no tracking — an internal landing page, a payment return page. On a hidden page CookieRay is off entirely: no banner, no blocking or restoring, no Consent Mode defaults, no consent recorded. In Strict mode a tracker WordPress enqueues there may stay blocked. Add to your child theme's functions.php or a snippets plugin:
add_filter( 'cookieray_should_load_banner', function ( $load ) {
if ( is_page( array( 'contact-thanks', 'order-received' ) ) || is_singular( 'landing' ) ) {
return false;
}
return $load;
} );
Conditional tags such as is_page(), is_singular() and is_front_page() work because the filter runs while the page head is built. Clear full-page caches after adding it, then check the page in a private window: no banner, and no tracking requests in the Network tab. To hide by country instead, use Geo targeting.
Settings reference
| Setting | Options |
|---|---|
| Consent Behavior | Log Consent Only or Block Until Consent |
| Consent Expiration → Ask for Consent Again After | 6 Months (new installs), 1 Year, 13 Months (the CNIL maximum), or Custom 1–3650 days |
| Consent Storage → Storage Duration | Presets or 30–3650 days; default 365 |
| Google Consent Mode v2 | On / off (on for new installs) |
| Uncategorized Cookie Handling | Always Block, or Treat as Marketing |
| Saved cookie categories | Reuse Saved Cookie Categories; Clear Saved Cookie Categories |
| Banner Display | Show Cookie Consent Banner; Show Floating Cookie Settings Button |
| Data Portability Export | Download consent records as CSV |
| Pro panels | Geo Targeting, Automated Cookie Scans, Integrations, Trust Badge — locked without a licence |
Settings are stored as WordPress options — cookieray_settings (including banner_enabled), cookieray_banner_settings and cookieray_db_version — so they travel with database backups and migrations.
Developer hooks
Add these to a child theme's functions.php, a snippets plugin or your own plugin. They match the plugin's code but are not a formal API promise — test after updates.
| Filter | Purpose |
|---|---|
cookieray_should_load_banner | Return false to switch CookieRay off for a request. See Hide the banner. |
cookieray_script_gate_allowlist | Hosts the Strict blocker lets through (matched as a substring of the script host). Only for scripts safe to load before consent. |
cookieray_frontend_config | The array printed as window.cookieRayConfig. Internal and may change — prefer admin settings. |
cookieray_scan_urls | URLs the scanner requests. Keep them on your own domain. |
cookieray_scan_sitemap_url_limit | Sitemap URLs per scan. Default 100; 0 skips the sitemap. |
add_filter( 'cookieray_script_gate_allowlist', function ( $hosts ) {
$hosts[] = 'js.example-widget.com';
return $hosts;
} );
add_filter( 'cookieray_scan_urls', function ( $urls ) {
$urls[] = home_url( '/members/' );
return $urls;
} );
add_filter( 'cookieray_scan_sitemap_url_limit', fn() => 40 );
| Action | Fires |
|---|---|
cookieray_consent_logged | After a consent record is saved. One array: visitor_hash, consent_id, status (accepted_all, declined, custom), categories, ip_country, user_agent (hash), page_url, banner_version. |
cookieray_scan_queued | A scan is queued from the admin. Passes the scan ID. |
cookieray_scan_completed | The server-side crawl finishes (script discovery may still be running). |
cookieray_deep_scan_completed | Script discovery finishes. Can fire more than once per scan — make handlers safe to repeat. |
add_action( 'cookieray_consent_logged', function ( $payload ) {
if ( 'declined' === $payload['status'] ) {
// For example, increment a counter of rejections.
}
} );
Data and uninstall
| Table | Holds |
|---|---|
{prefix}cookieray_cookies | Cookie inventory |
{prefix}cookieray_consent_logs | Consent records |
{prefix}cookieray_scans | Scan summaries |
{prefix}cookieray_third_party_scripts | Script-discovery results |
Country hints come only from your CDN or proxy headers, or the PHP GeoIP extension if installed — never an external API. Third-party trackers you add still collect data under their own policies once allowed.
Deleting the plugin from Plugins → Delete runs uninstall.php: it drops the four tables, removes the options and clears the scheduled purge. Back up your database first if you need the consent history.
Troubleshooting
Caching and other plugins
The banner starts from front-end scripts after the page loads, so it works alongside WP Super Cache, W3 Total Cache, WP Rocket, LiteSpeed Cache, SG Optimizer and others — but check it with your own caching rules. Clear caches after changing settings. Don't run two consent plugins at once.
Something behaves oddly
Switch temporarily to Log Only. If the problem goes away, it comes from script delaying; if not, it's elsewhere in your stack.
Pro feature missing
- The free plugin and the Pro add-on are both active, and the License screen shows License Active.
- Show Cookie Consent Banner is on — the trust badge and integration consent depend on it.
- Tag not in the page source: its switch is on and every ID is filled in (Adobe needs both). Tag loads twice: remove the other copy.
- GTM or Adobe doesn't load before the banner: expected in Strict mode. Meta Pixel loads before the banner: expected — it is revoked until Marketing consent.
- Custom CSS has no effect: check a real page, add
!importantand a longer selector, stay under 5,000 characters. - Geo targeting does nothing: your host sends no country header, or a page cache is shared.
- Scheduled scans don't run: WP-Cron is disabled or traffic is low.
Still stuck? Contact us with your WordPress, CookieRay and CookieRay Pro versions, what you expected, and whether you use a cache or CDN. Free users can also use the WordPress.org support forum.
FAQ
Does CookieRay block scripts automatically?
In Strict mode (Block Until Consent) it delays known trackers until the visitor allows their category. In Log Only it records consent without delaying scripts, but still removes known tracking cookies for refused categories.
Does Pro replace the free plugin?
No. Pro is an add-on that needs the free plugin installed and active.
Does CookieRay send data to CookieRay servers?
No. Consent logs and the inventory stay in your database unless you export them. Only the Pro add-on contacts the licence server, with your key, plugin version and activation details — never visitor data.
How are visitors' IP addresses handled?
Raw IPs are never stored — only a one-way SHA-256 hash of the IP and user agent, plus a 16-character hash prefix of the user agent.
Can I export consent logs?
Yes — CSV (up to 500 of the most recent matching records per export) and a PDF receipt for any single record, from Consent Logs.
Does it support multisite or IAB TCF?
Not in this release. CookieRay targets single-site installs and does not include IAB TCF.
Does deleting the plugin remove my data?
Yes. Plugins → Delete drops the four cookieray_* tables and the options. Back up first if you need the history.
Still stuck? Contact support.