Plugin Directory

EU Cookie Law

EU Cookie Law informs users that your site uses cookies, with option to lock scripts before consent. Light + Customizable style.

Shortcodes available

You can lock parts of code in posts, pages and widget with these shortcode:

[cookie] ... [/cookie]


[cookie height="100px" width="100%" text="Hi <b>WordPress</b>"] //My code [/cookie]

To display a box (in pages/posts) with ability to revoke consent (if cookies accepted) or accept cookies (if not done yet):


You can also create your own link that revokes cookie consent. Just append ?nocookie=1 to your url. Ex. wordpress.org/?nocookie=1 or wordpress.org/something/?nocookie=1

PHP Functions available

You can easily verify if cookies consent has been set with:

if ( function_exists('cookie_accepted') && cookie_accepted() ) {
    // Your code

However this will only hide wrapped code. If you want to display an info box, in php you have:

generate_cookie_notice($height, $width);
generate_cookie_notice_text($height, $width, $text);

if ( function_exists('cookie_accepted') && cookie_accepted() ) {
    // Your code
} else {
    generate_cookie_notice($height, $width);

(if you omit $text then the default one will be used)

Please note that cookie_accepted returns true if Eu Cookie Law plugin is set to disabled in settings panel.

If you think that we should provide more shortcodes, functions, or enhance what we already provide, please let us know in our forum.

Auto block (sperimental*)

The plugin offers an exclusive function that allows you to block iframes, embeds, objects and scripts in posts, pages and widgets. This can be activated in the plugin options panel because is disabled by default.

If you want to exclude a page from being filtered, you can set custom post field name eucookielaw_exclude to 1. To do this, enable "Custom Fields" in "Screen Options". Then in the "Custom Fields" box enter the name, the value, and hit "Add Custom Field".


We are working to get the plugin fully compatible with most cache plugins. At the moment using a cache service could create conflicts with the plugin.

WP Super Cache (sperimental*): open the file wp-content/advanced-cache.php and add the following immediately after <?php opening:

if ( !isset( $_COOKIE['euCookie'] ) ){ return; }

So that you have: `<?php if ( !isset( $_COOKIE['euCookie'] ) ){ return; }

Requires: 3.8 or higher
Compatible up to: 4.3
Last Updated: 2015-7-20
Active Installs: 8,000+


4.5 out of 5 stars


29 of 52 support threads in the last two months have been resolved.

Got something to say? Need help?


Not enough data

1 person says it works.
0 people say it's broken.

100,1,1 50,2,1
100,1,1 100,1,1 100,2,2 100,1,1 100,1,1 100,1,1 100,1,1 50,2,1 100,2,2 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1