WordPress.org

Ready to get started?Download WordPress

Forums

How to disable comment cookies? (3 posts)

  1. evo252
    Member
    Posted 1 year ago #

    Hi,

    I'm trying to completely disable cookies on comments form of my WordPress blog, and added this function to functions.php file of my theme:

    remove_action( 'set_comment_cookies', 'wp_set_comment_cookies' );

    However, the cookies have not been removed because comments form still keep name/e-mail/url when I leave a test comment as a logged out user. Is there something wrong with this line of code?

    Then, I tried this but it doesn't work too:

    add_filter('comment_cookie_lifetime', 'my_comment_cookie_lifetime');
    function my_comment_cookie_lifetime($lifetime) {
    return 3600;
    }

    Do you know why these both two functions are not working?

    Thanks!

  2. evo252
    Member
    Posted 1 year ago #

    Hi, nobody knows how to disable cookies or reduce their lifespan?

  3. Pioneer Valley Web Design
    Member
    Posted 1 year ago #

    Advise your customers how to use a modern browser to remove cookies on exit...

Topic Closed

This topic has been closed to new replies.

About this Topic