How to remove SSL Activated alert?

Home Forums Multisite How to remove SSL Activated alert?

This topic contains 5 replies, has 2 voices, and was last updated by  Mattia 2 months, 1 week ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #24971 Reply

    Blake

    Hi,

    How can I prevent the following text from being displayed at the top?

    “SSL activated! Don’t forget to change your settings in Google Analytics en Webmaster tools. More info.”

    I run a multisite, and every time a new site is made that alert pops up.

    #24972 Reply

    Hi, It should go away when you click the “x” in the right top corner. Did you already try that?

    Rogier

    #24991 Reply

    Blake

    Yes, but I would like to disable it from displaying overall. So I do not have to click the X every time (Ok, I know, not that big of a deal, but it is confusing some people in my network on what it is)

    #25039 Reply

    Yes, I understand. A good idea for the plugin I guess. I’ll add it to the to do list.

    For now, you can use a simple script, which requests all sites one by one, then sets the “ssl_success_message_show” option to true, and saves it. This function needs wp 4.6 or higher.

    $sites = get_sites();
    foreach ( $sites as $site ) {
      switch_to_blog($site->blog_id );
      $options = get_option('rlrsssl_options');
      $options['ssl_success_message_shown'] = TRUE;
      update_option('rlrsssl_options',$options);
      restore_current_blog(); //switches back to previous blog, not current, so we have to do it each loop
    }

    If you paste this in your functions.php, and let it run once, all sites will have this option updated.

    #25040 Reply

    Just saw I missed a part of your question. If you need this message not to pop up on new sites as well, you need a hook that hooks in to the new site creation, then set the value to true:

    function rsssl_prevent_ssl_message( $blog_id, $user_id, $domain, $path, $site_id, $meta ) {
      switch_to_blog($blog_id );
      $options = get_option('rlrsssl_options');
      $options['ssl_success_message_shown'] = TRUE;
      update_option('rlrsssl_options',$options);
      restore_current_blog(); //switches back to previous blog, not current, so we have to do it each loop
    }
    add_action( 'wpmu_new_blog', 'rsssl_prevent_ssl_message', 10, 6 );

    I think you would need to add this to the mu-plugins folder, so it will execute always for all sites.

    #111602 Reply

    Mattia

    Dear Rogier,

    Weirdly enough I do not get an “X” to close this and it follows me since I’ve activated SSL…

    Any simple handling?

    Best,
    Mattia

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: How to remove SSL Activated alert?
Your information: