X

How To Remove the Screen Options Tab in WordPress

Snippets by IsItWP

Are you looking for a way to remove the screen options tab? These snippets can be useful in the case you made modifications to the admin and want to hide the screen options.

Instructions:

Add one of the following snippets to your theme’s functions.php file or in a site-specific plugin.

  • This snippet will remove the screen options tab completely.
  • function remove_screen_options(){
        return false;
    }
    add_filter('screen_options_show_screen', 'remove_screen_options');
    
  • This snippet will remove the screen options tab for everyone but the admin or users with the manage_options capability.
    function remove_screen_options(){
       return current_user_can( 'manage_options' );
    }
    add_filter('screen_options_show_screen', 'remove_screen_options');
    

Note: If this is your first time adding code snippets in WordPress, then please refer to our guide on how to properly copy / paste code snippets in WordPress, so you don’t accidentally break your site.

If you liked this code snippet, please consider checking out our other articles on the site like: How to Create a Custom User Registration Form in WordPress and 43 simple WordPress themes to easily start a website.

Comments   Leave a Reply

  1. Cristian Hidalgo January 29, 2024 at 12:28 am

    Worked like a charm, thanks a lot.

  2. How to only show some widget in dashboard?
    for example, in woocommerce
    I want to show woocommerce status widget for role shop manager

  3. I am 100% confident that this will not remove anything checked inside the screen options. Some themes can come up with their own screen options which is usually checked by default. This code will not remove them. So it is useless.

    1. We have tested it and at the moment it is working. Screen options are not directly part of the theme, though theme code could influence them.

  4. The api call
    add_filter(‘screen_options_show_screen’, ‘remove_screen_options’);

    does not work on version wordpress 5.2.4 please update the article.

    1. Be sure to add the whole snippet. Adding

      add_filter(‘screen_options_show_screen’, ‘remove_screen_options’);

      by itself will not work. From testing it, the snippet works on WordPress 5.3.

Add a Comment Cancel reply

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!