How to Hide the Screen Options Tab in WordPress

Home » Snippets » How to Hide the Screen Options Tab in WordPress
0

Created with:

Visibility: 

public

Creator: WPTurbo Team

Customize with WPTurbo AI
X

Add Snippet To Project

New Project
Add To Existing Project

Are you tired of the clutter on your WordPress dashboard? Do you find yourself rarely using the Screen Options tab and wishing you could hide it altogether? Well, you’re in luck! In this article, we’ll show you how to easily hide the Screen Options tab in WordPress, giving you a cleaner and more streamlined dashboard experience. Say goodbye to unnecessary distractions and hello to a more focused and efficient workflow.

					function wpturbo_hide_screen_options_tab() {
    echo '<style>#screen-options-link-wrap {display: none;}</style>';
}
add_action('admin_head', 'wpturbo_hide_screen_options_tab');
```
				

The code snippet provided allows you to hide the "Screen Options" tab in the WordPress admin dashboard.

To achieve this, we define a function called wpturbo_hide_screen_options_tab(). This function is responsible for outputting inline CSS that will hide the "Screen Options" tab.

Inside the function, we use echo to output the CSS code as a string. The CSS code is encapsulated within <style> tags. The code targets the #screen-options-link-wrap element and sets its display property to none, effectively hiding the entire tab.

echo '<style>#screen-options-link-wrap {display: none;}</style>';

The next step is to hook the wpturbo_hide_screen_options_tab() function into the admin_head action. This ensures that the function is executed when the admin dashboard is being rendered.

add_action('admin_head', 'wpturbo_hide_screen_options_tab');

By hooking into this action, the CSS code is added to the <head> section of the admin dashboard, allowing the "Screen Options" tab to be hidden.

Note: It is important to keep in mind that hiding the "Screen Options" tab will also hide any options that it controls. Therefore, it is crucial to consider the implications and potential impact on the user experience before implementing this customization.

Register an account to save your snippets or go Pro to get more features.