• Resolved boutzamat

    (@boutzamat)


    Hello. It seems that the cookie bar and button is being shown even when logged in.

    There is no option in the plugin, to disable the cookies when logged in.

    It could easily be implemented, by only enqueuing the javascript, when the user is logged in.

    For now, i will try to see if i can remove it with a filter, but please consider implementing this out of the box, as no logged in user is interrested in seing AND wasting pageviews by watching their own cookie consent box.

    For anyone who experience this problem, here’s a solution (add this to your functions.php):

    PHP 7.4+
    add_action('wp_enqueue_scripts',fn () => ( is_user_logged_in() || is_login() ) && wp_deregister_script('cookie-law-info') );

    PHP 7.3
    add_action('wp_enqueue_scripts',function () {
    if ( is_user_logged_in() || is_login() ) {
    wp_deregister_script('cookie-law-info');
    }
    });
    • This topic was modified 1 year, 4 months ago by boutzamat.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support CookieYes Team

    (@cookieyesteam)

    Hi boutzamat,

    Greetings from CookieYes!

    Thank you for sharing your feedback and the workaround you’ve implemented. We truly appreciate the effort you’ve put into providing a solution for other users.

    Currently, the CookieYes plugin does not include a built-in option to disable the cookie bar for logged-in users. We’ve taken note of your suggestion and will forward it to our development team for consideration in future updates.

    Plugin Support CookieYes Team

    (@cookieyesteam)

    Hi boutzamat,

    This thread has been inactive for a bit, so we are going to mark it as Resolved now. Please feel free to open a new thread or follow up if you have any questions or have anything else to share.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Hide Cookiebar/button when logged in’ is closed to new replies.