Resolving Cookie Banner Accessibility and Display Issues
Content
Many users of the 'Cookie Notice & Compliance for GDPR / CCPA' plugin encounter issues related to accessibility and banner behavior. These problems can affect user experience and compliance. Based on common community reports, here are the most frequent issues and their solutions.
Common Accessibility Issue: Incorrect ARIA Role
The Problem: The cookie banner uses the ARIA role role="banner". According to the W3C ARIA specification, the 'banner' landmark role should be used only once per page. Since most themes use this role for the site's main header, the duplicate role on the cookie banner creates an accessibility error.
The Solution: The development team has acknowledged this issue. In a response to a user, they stated: "We could change the 'role' attribute to 'dialog' in the next release – it would be more accurate probably." Until an official update is released, users can employ a custom filter or directly edit the plugin's template files, though the latter method is not recommended as changes will be lost on update.
Banner Does Not Stay on Scroll
The Problem: Even when the "Disable on scroll" option is unchecked in the plugin's settings, the banner continues to disappear when a user scrolls the page.
The Solution: This is a confirmed bug. Community members have identified a fix within the front.js file. The conditional check if( cnArgs.onScroll && cnArgs.onScroll=="yes") was found to be the source of the problem. The plugin's author, Bartosz from dfactory, confirmed a fix would be pushed in an update. If you are experiencing this issue, ensure your plugin is updated to the latest version.
Close Button is Not Keyboard Accessible
The Problem: Users who navigate with a keyboard cannot tab to the banner's close button (the "X"), which is a critical accessibility failure.
The Solution: This has been reported to the plugin's team. A proper fix requires making the close button a focusable element (e.g., with tabindex="0") and ensuring it can be activated using the 'Enter' key. This is a core code change that must be addressed in a plugin update. Users are encouraged to keep the plugin updated to receive this accessibility improvement.
Banner Appears on WordPress Login Screen
The Problem: The cookie banner incorrectly loads on the WordPress login dialog, which can break the layout of the login form.
The Solution: A bug in the logic was identified in the frontend.php file. The conditional check on line 442 was comparing the wrong hook. The development team confirmed the issue and stated: "We will adjust that in the upcoming new version of the plugin." The best course of action is to update the plugin once a new version is available.
Important Note: For all bugs mentioned, the primary solution is to ensure you are running the latest version of the plugin, as the development team has committed to fixing these issues in future updates. Always test updates on a staging site first.
Related Support Threads Support
-
Remove plugin options on uninstall, not on deactivationhttps://wordpress.org/support/topic/remove-plugin-options-on-uninstall-not-on-deactivation/
-
How to hide the banner when scroll down?https://wordpress.org/support/topic/how-to-hide-the-banner-when-scroll-down/
-
Modify URL Bannerhttps://wordpress.org/support/topic/modify-url-banner/
-
Wish: full screen layerhttps://wordpress.org/support/topic/wish-full-screen-layer/
-
Enable conditional display of the bannerhttps://wordpress.org/support/topic/enable-conditional-display-of-the-banner/
-
Accessibility issueshttps://wordpress.org/support/topic/accessibility-issues-22/
-
HTML Modernization, PLShttps://wordpress.org/support/topic/html-modernization-pls-%f0%9f%99%8f/
-
Disable On scrollhttps://wordpress.org/support/topic/disable-on-scroll/
-
How to remove the close button?https://wordpress.org/support/topic/how-to-remove-the-close-button/
-
How to change role=”banner” ?https://wordpress.org/support/topic/how-to-change-rolebanner/
-
Add disable switch or better logic for WordPress login dialoghttps://wordpress.org/support/topic/add-disable-switch-or-better-logic-for-wordpress-login-dialog/
-
Cookie Banner close button is not keyboard accessiblehttps://wordpress.org/support/topic/cookie-banner-close-button-is-not-keyboard-accessible/
-
Load Cookie Banner only on Homepagehttps://wordpress.org/support/topic/load-cookie-banner-only-on-homepage/