
We created the WP Cookie Consent Plugin to help WordPress developers and WordPress site owners comply with the EU Cookie Directive.
The plugin is free and Open Source, grab the code from GitHub
Why WP Cookie Consent
While there are number of great WordPress cookie law plugins available, none quite met our requirements to be:
- unobtrusive but clear to users
- very easy to brand and customise
- lightweight in code
Starting from DareToThink’s Free EU Cookie Law Script we developed WP Cookie Consent to meet our needs and the needs of our clients. We hope it is helpful to others.
About the Plugin
WP Cookie Consent is a lightweight plugin designed for WordPress developers and others with CSS knowledge to comply with the EU Cookie Directive.
In this implementation, a cookie warning message is displayed at the top of the website. If and when a user accepts the site’s use of cookies, code for cookies requiring users’ explicit acceptance – e.g. Google Analytics – is included in the site until the cookie expires in 2022 or a user manually clears their cookies.
Customizing the Plugin
All text used in the cookie warning is configurable through the WordPress Back Office.
Any code for cookies that should be run on condition of users’ consent may also be configured in the Back Office. If present, this code will be placed at the bottom of the site’s head.
Styles of all elements used in the cookie warning message may be customized by adding your chosen styles in the Back Office settings. If present, this CSS will be included as an internal style sheet in the head. Of course, styles may be declared in developers’ external style sheets; just delete the declarations made in the plugin settings.
Can you please explain how to get the little green box appear briefly on you site like yours did?
Hi GT, Thanks for your comment. We’ve used PHP and jQuery to implement a cookie consent message as a div that fades after a set period of time.
Hi
Just wondered if there is a way to hide the cookie consent plugin from editors in the admin panel?
Regards
Mandy
Hi Mandy, thanks for your interest in our plugin. I’m afraid that feature is not included in the plugin at this time, but we will add it to the feature list for consideration.
I would be grateful if you could help. I really like your plugin but it is not being validated by W3. Could you please tell me how I can modify your files to get rid of these errors. Many thanks. Errors are listed below:
Element style not allowed as child of element body in this context. (Suppressing further errors from this subtree.)
Element style not allowed as child of element body in this context. (Suppressing further errors from this subtree.)
Stray end tag head.
An body start tag seen but an element of the same type was already open.
…page-parent page-template page-template-full-width-page-php custom-background”>
Cannot recover after last error. Any further errors will be ignored.
…page-parent page-template page-template-full-width-page-php custom-background”>
Hi Alice, thanks for your comment and for highlighting these issues. We’ll put them on the todo list next time we’re working on the plugin. At this point we couldn’t give any details, but feel free to dig around in the code!
Thank you very much for your reply. Hopefully you’ll be able to provide more information soon. I could try to dig around in the code but which file should I be looking into? There are several php files.
Thank you.
Hi Alice, I’m afraid I can’t provide any further information at this time due to other obligations. Deepest apologies.