Cookie consent banner for WordPress. Two modes: Full (blocks analytics and marketing until the visitor agrees) and Simple (an informational notice). Works in English and Hebrew (RTL), supports WPML and Polylang.
Table of contents
- Quick start
- FAQ and troubleshooting
- Button colors look different
- A site popup covers the banner
- The banner covers a chat widget or other content
- I don’t want the banner on a specific page
- My changes do not appear on the site
- The banner does not appear, or its buttons do not respond
- The banner does not appear in Brave or with an ad blocker
- Consent modes
- Blocking tracking code added by your theme
- Let visitors change their choice
- Settings, tab by tab
- WooCommerce checkout
- For developers
- Related pages
Quick start
- Open Settings → ATR Cookie Notice.
- In the General tab, make sure Enable Cookie Banner is checked.
- Choose the Consent Mode: Full if you must block tracking until consent, Simple if you only need to inform visitors. See Consent modes.
- Set your Privacy Policy page in Settings → Privacy (WordPress core). The banner’s Privacy Policy link points to it.
- Choose Banner Position and Banner Side. Check the look in the live preview of the Styling & Appearance tab.
- Click Save Changes, then Purge caches and refresh assets, and check the site in a private window.
FAQ and troubleshooting
A site popup covers the banner
Some popup plugins show their window, or a dark layer, above the cookie banner, so visitors cannot click it.
Raise Styling & Appearance → Banner Z-Index. The maximum value is 2147483647, which places the banner above almost everything. Visitors can also drag the banner aside (see below).
The banner covers a chat widget or other content
- Set General → Banner Side to the other side of the screen.
- Visitors can drag the banner aside using the grip dots in its top corner, with the mouse, a finger or the arrow keys. Moving the banner is not consent, and the position is not remembered on the next page.
I don’t want the banner on a specific page
For example, a donation landing page. Add the page ID to General → Hide Banner on Pages (comma-separated, e.g. 12, 345). The ID appears in the page’s edit URL (post=12).
Warning: on these pages the banner is not shown and tracking scripts are not blocked, even in Full mode. Visitors there are not informed and no consent is collected.
My changes do not appear on the site
Click Purge caches and refresh assets at the top of the settings page, clear any page cache or CDN, and check in a private window.
The banner does not appear in Brave or with an ad blocker
Brave (cookie notice blocking in Shields), uBlock Origin and AdGuard can use the public “EasyList Cookie” filter list. It blocks cookie-notice files by name, including the plugin’s CSS and JavaScript, so the banner is not shown.
- This is the visitor’s own choice; the plugin does not try to get around it.
- The visitor never consents, so scripts wrapped with
data-consentnever run for them. - The banner stays hidden; no unstyled buttons appear at the bottom of the page.
- To test the banner yourself, use a browser without these blockers, or turn the blocker off for your site.
Consent modes
| Full (default) | Simple | |
|---|---|---|
| Purpose | Ask for consent before tracking | Inform visitors |
| Buttons | Accept All, Reject Non-Essential, Preferences | OK, Privacy Policy link |
| Blocks analytics / marketing until consent | Google Analytics and Facebook Pixel functions; tracking code from the theme must be wrapped (see block-tracking-code) | No |
| Visitor can choose categories | Yes (Preferences) | No |
| When to choose | You must block non-essential tracking until consent | A transparent notice is enough |
Blocking tracking code added by your theme
Important: Full mode disables the Google Analytics and Facebook Pixel functions until consent, but it does not stop tracking code that your theme or another plugin prints into the page – for example a Google Tag Manager snippet in the theme header, or code added with a “header/footer scripts” plugin. That code runs before the visitor decides.
The fix: wrap the code with the plugin’s consent marker. Change only the opening <script> tag; leave the code inside as it is.
Before:
<script>
(function(w,d,s,l,i){ ... 'https://www.googletagmanager.com/gtm.js?id=' ... })(window,document,'script','dataLayer','GTM-XXXX');
</script>
After:
<script type="text/plain" data-consent="analytics">
(function(w,d,s,l,i){ ... 'https://www.googletagmanager.com/gtm.js?id=' ... })(window,document,'script','dataLayer','GTM-XXXX');
</script>
Which category to use:
| Code | Marker |
|---|---|
| Google Tag Manager, Google Analytics (gtag.js) | data-consent="analytics" |
| Facebook Pixel, Google Ads, other advertising | data-consent="marketing" |
Scripts with src work the same way:
<script type="text/plain" data-consent="marketing" src="https://connect.facebook.net/en_US/fbevents.js"></script>
How it works:
- The browser does not run a script whose type is
text/plain, so nothing is sent before the visitor decides. - When the visitor consents to that category, the plugin turns the script into a normal one and runs it.
- If the visitor rejects, the script never runs.
Where it works: anywhere the code is printed into the page – the theme’s header.php, functions.php (wp_head), “Insert Headers and Footers” / WPCode / Code Snippets, page-builder custom code.
Where it does not work:
- Code that another JavaScript file creates while the page runs.
- The
<noscript>parts of Google Tag Manager (<iframe src="https://www.googletagmanager.com/ns.html?id=...">) and Facebook Pixel (<img src="https://www.facebook.com/tr?...">). They load only when JavaScript is off; then no banner can ask for consent and the data is sent anyway. They cannot be wrapped – remove them. Visitors with JavaScript on are not affected. - Tags configured inside Google Tag Manager: once GTM runs (Analytics consent), all its tags run, including a Facebook Pixel tag. Keep advertising tags out of GTM, or load them separately with
data-consent="marketing". - Code that Cloudflare adds (for example Cloudflare Web Analytics) and server-side tracking (Facebook Conversions API).
Let visitors change their choice
Add the shortcode [atr_cookie_notice_settings] to the privacy policy page, the footer or a menu widget. It shows a “Cookie settings” link; clicking it forgets the stored choice and shows the banner again. Change the link text with [atr_cookie_notice_settings text="Manage cookies"].
Settings, tab by tab
General
| Setting | What it does |
|---|---|
| Enable Cookie Banner | Turns the banner on or off for the whole site. |
| Consent Mode | Full or Simple. See Consent modes. |
| Banner Position | Bottom, Top, or Overlay (centered). |
| Banner Side | Right or Left, for the Bottom and Top positions. Physical side: Right is right on Hebrew sites too. |
| Hide Banner on Pages | Page/post IDs where the banner does not run. See the FAQ. |
| Auto-hide Delay | Hides the banner after N seconds (0 = never). |
Cookie Categories
- Essential cookies are always on and cannot be disabled (sessions, security, language).
- Analytics (e.g. Google Analytics) and Marketing (e.g. Facebook Pixel, Google Ads) can be shown or hidden in the banner.
- Their default state is unchecked; you can change the default per category.
Styling & Appearance
- Colors: primary, secondary, text, background, links, and both button types (background and text), with color pickers.
- Typography: font family, size, weights, uppercase buttons.
- Layout: corner radius, paddings, gaps, maximum width, direction, alignment.
- Overlay and stacking: overlay color and opacity, Banner Z-Index, shadow.
- Custom CSS for anything else.
- A live preview updates as you edit, before saving.
- Reset Styling to defaults (in the tools at the top of the settings page) resets only this tab.
Content
Replace the banner’s default text and buttons. Leave a field empty to keep the default text, which is already translated.
Fields:
- Simple Mode – Text HTML, Simple Mode – Actions HTML
- Full Mode – Text HTML, Full Mode – Actions HTML, Full Mode – Footer HTML
| Token | Output |
|---|---|
{site_name} | The site name |
{privacy_url} | The Privacy Policy page URL |
{privacy_link} | A full link with the Privacy Policy page title |
[ok_button] | OK button (Simple) |
[privacy_link] | Privacy Policy link (Simple) |
[accept_all_button] | Accept All button (Full) |
[reject_button] | Reject Non-Essential button (Full) |
[preferences_button] | Preferences button (Full) |
- Allowed HTML:
a,button,strong,em,span,br,p. - If you remove a required button, the plugin adds it back so the banner always works.
Multilingual sites (WPML / Polylang)
The plugin settings are one set for the whole site. The Content fields are translated with your multilingual plugin:
- Write the text in the Content tab in the site’s default language, and save.
- Translate it following your multilingual plugin’s guide:
- WPML: Registering strings from the admin area and plugin settings. In the Admin Texts screen, look for
atr-cookie-notice. - Polylang: Strings translation. The strings are in the
plugins/atr-cookie-noticegroup.
- WPML: Registering strings from the admin area and plugin settings. In the Admin Texts screen, look for
- Check each language on the site in a private window.
Empty fields use the built-in default text, which already follows the site language. After changing the original text, update its translations too.
Advanced Options
- Design Preset: Light, Dark, Minimal or High Contrast. Applies on save. To customize a preset, save it first, then change colors and save again.
- Force override theme styles: see the FAQ.
- Enable Debug Mode: for developers, see For developers.
- Cookie Expiry (days): how long the visitor’s choice is remembered (default 365).
Tools
At the top of the settings page:
- Purge caches and refresh assets: gives the plugin’s CSS/JS files a new version number so browsers and caches load the new files, and purges common cache plugins when installed.
- Reset Styling to defaults: resets only the Styling & Appearance tab, after a confirmation.
WooCommerce checkout
WooCommerce shows its own privacy policy link on checkout; this plugin does not add a checkbox there.
- WooCommerce → Settings → Accounts & Privacy.
- Enable “Add a privacy policy link to your checkout page”.
- Make sure a Privacy Policy page is set in Settings → Privacy.
Classic (non-block) themes: add [privacy_policy] under Customizer → WooCommerce → Checkout → Terms and conditions.
For developers
Filters
| Filter | Purpose |
|---|---|
atr_cookie_notice_text_html_simple, atr_cookie_notice_text_html_full | Change the banner text HTML after token replacement |
atr_cookie_notice_actions_html_simple, atr_cookie_notice_actions_html_full | Change the buttons HTML after token replacement |
atr_cookie_notice_is_excluded_page | Return true to stop the banner on the current page (arguments: $excluded, $post_id) |
atr_scb_settings_fields | Add or change settings fields |
Tracking that Full mode controls:
- Analytics: Google Analytics (
gtag,ga), Google Tag Manager (dataLayer.push). - Marketing: Facebook Pixel (
fbq). - Before consent these functions are replaced with empty ones; after consent the originals are restored per category.
- Scripts marked
type="text/plain" data-consent="analytics|marketing"run only after consent to that category (seeblock-tracking-code).
Stored choice: cookie atr_cookie_notice_consent (JSON) and atr_cookie_notice_consent_given, plus localStorage. Expires after “Cookie Expiry (days)”.
JavaScript API: window.atrCookieNotice (window.scb is kept as a deprecated alias).
Debug mode (Advanced Options → Enable Debug Mode):
- Open a page and run
window.atrCookieNotice.clearConsent()in the console (the page reloads). - Before consent,
window.gtag._scbBlocked,window.ga._scbBlockedandwindow.fbq._scbBlockedaretrue. window.atrCookieNotice.testTracking()sends test calls.- Click Accept All and check that the flags are gone.
Text domain: atr-cookie-notice. License: GPL-2.0+.
