How to remove welcome screen and its screen option checkbox?

Clicking the screen options on dashboard, the drop down area has welcome checkbox. So even after hiding the welcome screen, if user chooses to display the welcome screen. It still shows.

Is there a way to hide this option completely and turn off the welcome screen?
Or otherwise, a way to remove the welcome content completely and replace it with something else?

Related posts

Leave a Reply

4 comments

  1. You can remove (turn-off) the Welcome screen by using any of these two options:

    Single:

    add_action( 'load-index.php', 'hide_welcome_screen' );
    
    function hide_welcome_screen() {
        $user_id = get_current_user_id();
    
        if ( 1 == get_user_meta( $user_id, 'show_welcome_panel', true ) )
            update_user_meta( $user_id, 'show_welcome_panel', 0 );
    }
    ?>
    

    Multisite:

    <?php
    if ( ! defined( 'ABSPATH' ) || ! is_multisite() )
        return;
    add_action( 'load-index.php', 'hide_welcome_screen_for_multisite' );
    
    function hide_welcome_screen_for_multisite() {
        $user_id = get_current_user_id();
    
        if ( 2 == get_user_meta( $user_id, 'show_welcome_panel', true ) )
            update_user_meta( $user_id, 'show_welcome_panel', 0 );
    }
    ?>
    

    The state of the welcome panel is stored in a usermeta key that is global to the network. The value of 0 means the welcome panel should not be shown (and has been dismissed).
    The value of 1 means the welcome panel should be shown. (The initial user for a ingle-site WordPress install is given this value) .
    The value of 2 is specific to multisite, and means that the panel should only be shown if the user is the site owner.

    Once dismissed, the panel can be shown by visiting the Screen Options tab.

    I hope that helps.

  2. You can hide the Welcome checkbox using some simple CSS:

    [for="wp_welcome_panel-hide"] {
        display: none !important;
    }
    

    To add the CSS code to your WP-ADMIN pages, simply add this in your theme’s functions.php file before the last ?>:

    function my_custom_admin_head() {
            echo '<style>[for="wp_welcome_panel-hide"] {display: none !important;}</style>';
    }
    
    add_action('admin_head', 'my_custom_admin_head');
    

    Note that I am using CSS3 selector in the code, I believe it works in IE7+ and newer.

    PS: If you are already enqueuing a custom stylesheet file for WordPress Dashboard pages, obviously, you should add the CSS code in that CSS file. If not, I wouldn’t bother creating one just for this code (1. it’s not public facing, 2. unnecessary HTTP requests).

  3. You can remove the panel and the checkbox for it by getting rid of the ‘welcome_panel’ action.

    add_action( 'wp_dashboard_setup', 'remove_welcome_panel' );
    function remove_welcome_panel() {
        global $wp_filter;
        unset( $wp_filter['welcome_panel'] );
    }