Jul 25, 2006
I added a link on the comment form to clear the commenter's info. Some people think it's weird that my site remembers their name and email address. Don't worry, I probably won't sell your personal information to a marketing company. Probably.
I put this PHP code in my header:
I put this PHP code in my header:
And I added a link toif($_GET['deletecookie']) {
setcookie('comment_author_' . COOKIEHASH, '', time() + 30000000, COOKIEPATH, COOKIE_DOMAIN);
setcookie('comment_author_email_' . COOKIEHASH, '', time() + 30000000, COOKIEPATH, COOKIE_DOMAIN);
setcookie('comment_author_url_' . COOKIEHASH, '', time() + 30000000, COOKIEPATH, COOKIE_DOMAIN);
unset($comment_author, $comment_author_email, $comment_author_url);
$location = $_SERVER['HTTP_REFERER'];
wp_redirect($location);
}
?deletecookie=1 in the comment form. It's relatively simple, but it took a while to figure out. I tried a few plugins that claimed to do this for me, but nothing seemed to work, so I went with the manual code. #technology