WordPress comments EU privacy

WordPress comments EU privacy

This post is about the new EU privacy directive which states that users of a website need to consent to receiving cookies – they cannot be placed on a users computer without that consent.

WordPress has a good commenting system, the trouble with it is that it creates three cookies containing the name, email and web address of the person who comments on a post. This is strictly outside of the EU privacy Directive on cookies.

The workaround is to upgrade wordpress to v3.4 and take advantage of a change which makes it easy to control the setting of these cookies (rather than editing core files). The bug trac for this is http://core.trac.wordpress.org/ticket/17976

Basically add the following code into your theme functions file

remove_action('set_comment_cookies', 'wp_set_comment_cookies', 10,2);

And thats it – no cookies set when someone posts a comment. Of course it has its drawbacks in terms of functionality. But it will do for the moment.

Oliver Partridge

Building websites since 2000, I have a wealth of experience in eMarketing, SEO, e-mail marketing and social media marketing. Google+ and Twitter

Leave a Reply


  • WordPress category in body class

    Website Design & Development Wordpress

    Either add the following into your header.php: <body class="<?php foreach((get_the_category()) as $cat) { echo $cat->category_nicename; } ?> Or add the following into your theme functions.php:

  • Website Build: Perfect-Shirts.co.ukWebsite Build: Perfect-Shirts.co.uk

    Website Build: Perfect-Shirts.co.uk

    Website Design & Development

    Last year I blogged about a logo concept for a website called Perfect-Shirts.co.uk. Well the concept has finally been made into a live website, perfect-shirts.co.uk

  • Getting Commission Junction’s API to workGetting Commission Junction’s API to work

    Getting Commission Junction’s API to work

    Website Design & Development

    I have seen a few posts on various affiliate forums that attempt to help in getting the Commission Junction (CJ) API working. The API allows