The ‘Screen Options’ tab, found in the top right corner of many admin screens in WordPress, provides controls to customize what’s displayed on the current screen. This can be useful for advanced users looking to customize their view, but it may confuse or overwhelm less experienced users.
This code snippet allows you to hide the ‘Screen Options’ tab from all admin screens in your WordPress site. It uses the add_filter
function to modify the ‘screen_options_show_screen’ filter, which controls the display of the ‘Screen Options’ tab.
The __return_false
function is a built-in WordPress function that simply returns false
. By passing this function as the callback for the ‘screen_options_show_screen’ filter, you’re telling WordPress to always hide the ‘Screen Options’ tab.
This snippet doesn’t need customization and will work as it is. However, be careful when using it, as hiding the ‘Screen Options’ tab will prevent all users from being able to customize their admin screens.
// Hide admin 'Screen Options' tab
add_filter('screen_options_show_screen', '__return_false');