Find out why the Cookie Notice bar is missing or stays open and fix it
The Cookie Notice kit in TermsFeed AutoTerms hides its bar by design from browsers that closed it, and from logged-in users while "Disable for logged-in users" is "yes", the default. In every other case, a setting, a cache, or another script keeps the bar hidden.
Search the page source (Ctrl+U, or Cmd+Option+U on a Mac) for wpautoterms-cookies-notice. A page with <div class="wpautoterms-cookies-notice" style="display:none"> received the bar, which the script in the browser kept hidden. A page without it never received the bar.
Cause 1: You are logged in with "Disable for logged-in users" set to yes
The Cookie Notice hides from every logged-in user while "Disable for logged-in users" is "yes", which is the default.
Close every private window and open the page in a new one, which starts logged out and shows the bar. In the page source of your normal window, a "disable":"1" value in wpautoterms_js_cookies_notice points to this cause, and an empty value rules it out.
A page cached for a logged-in user hides the bar from logged-out visitors too, as W3 Total Cache does while "Don't cache pages for logged in users" is off. To see the bar while logged in, change the setting.
- Set "Disable for logged-in users" to "no" on the Cookie Notice screen, and click the "Save Changes" button.
- Clear the page cache.
Cause 2: You closed the Cookie Notice within the last 7 days
Clicking the "Close" link stores the cookie wpautoterms-cookies-notice with the value 1, and the bar stays hidden in that browser for 7 days, until the cookie expires. Each site of a multisite network, and a site in a subdirectory, keeps its own cookie.
Find the cookie in the Application tab of DevTools, under Cookies and the domain of your WordPress website. Close every private window and open a new one, which does not hold the cookie yet. To test in your normal window, change the setting and delete the cookie.
- Set "Disable for logged-in users" to "no" on the Cookie Notice screen, and click the "Save Changes" button.
- Right-click
wpautoterms-cookies-noticein the Application tab of your normal window, and delete it. - Reload the page and confirm the bar.
Cause 3: The Cookie Notice kit is off
The Cookie Notice kit is off after install, and it turns on only from the Compliance Kits screen. Saving the settings on the Cookie Notice screen leaves the kit off, and its box on TermsFeed > Compliance Kits shows "Disabled".
Run either the Cookie Notice kit or the Cookie Consent kit, never both. Compare the 2 kits in Add a Cookie Notice Bar to WordPress.
- Click the "Enable" button in the Cookie Notice box, which shows "Cookie Notice enabled." at the top of the screen.
- Clear the page cache.
- Close every private window, open a new one, load the page, and confirm the bar.
Cause 4: A page cache stores the page without the bar
Some page caches store the page without the top bar, so visitors who get a cached page do not see the Cookie Notice at the top. The top bar appears under a page cache that stores it with the page, such as WP Super Cache or Cache Enabler. The bottom position works under every page cache.
Close every private window, open a new one, and search the page source for id="wpautoterms-top-static-container" or id="wpautoterms-top-fixed-container". Search the plain address, then the address with ?nocache=1. A container only on the second address means the cache stores the page without the top bar. A cache or content delivery network (CDN) that ignores query strings serves its stored copy on both addresses, so clear its cache instead.
The Advanced tab of TermsFeed > Settings shows "Unsupported caching plugins detected. We recommend enabling this option." once the plugin finds that your page cache serves pages without the top bars. Compatibility mode prints the top bar where the cache keeps it. Read when to use it in WordPress Caching Plugins.
- Open TermsFeed > Settings, select the Advanced tab, turn on "Caching plugins compatibility mode", and click the "Save Changes" button.
- Clear the page cache, as the hint "Clean/delete cache after enabling or disabling this option." asks.
- Close every private window, open a new one, load the page, and confirm the bar at the top.
Cause 5: A page speed plugin removes jQuery or stops it from running
The bar appears only once jQuery runs on the page, so a page speed plugin that removes jQuery, or stops it from running while combining files, keeps the bar hidden. A removed wp-util script keeps it hidden too. A plugin that delays jQuery until the first scroll or click only delays the bar.
A red line such as Uncaught ReferenceError: jQuery is not defined in the Console tab points to a missing jQuery. In the Network tab, filtered for auto-terms-of-service, no wpautoterms.js request or a status other than 200 points to a removed or combined script. A red error from the combined file confirms it. Read when the bars need a combine exclusion in TermsFeed AutoTerms Script and Style Handles.
- Turn off any page speed option that removes jQuery from your WordPress website.
- Exclude jQuery,
wp-util, and the AutoTerms plugin scripts from combining only while the Console shows an error in the combined file. Use the form your page speed plugin asks for, such as/wp-includes/js/jquery/,/wp-includes/js/wp-util, andauto-terms-of-service-and-privacy-policy/js/. - Clear the cache of the page speed plugin, close every private window, load the page in a new one, and confirm the bar.
Cause 6: Another element covers the "Close" link
A "Close" link that does nothing points to another element that covers the bar and takes the click. Errors in other scripts do not stop the "Close" link.
Right-click the "Close" link and select Inspect. Any element the Elements tab selects other than a.wpautoterms-notice-close covers the link. Lower its z-index, or move the bar with "Announcement bar position".
Cause 7: The browser blocks the Cookie Notice cookie
A bar that closes and returns on the next page points to a browser setting or a cookie blocker extension that blocks the cookie wpautoterms-cookies-notice.
Click the "Close" link, then open the Application tab and expand Cookies. No wpautoterms-cookies-notice for the domain of your WordPress website confirms this cause. Allow cookies for your WordPress website in the browser, or in the cookie blocker that runs in it.
How to verify that the Cookie Notice shows and closes
- Save your change, clear the page cache, close every private window, open a new one, and load a page of your WordPress website.
- Confirm that the bar shows the message at the position you chose, with the "Close" link. A bar set to "bottom" and "static" shows only once you scroll to the end of the page.
- Click the "Close" link and confirm that the bar disappears.
- Open the Application tab, expand Cookies, and confirm
wpautoterms-cookies-noticewith the value1. - Open a second page and confirm that the bar stays closed.