9

I would like to remove screen options and help links in my admin area. How to remove that thing?.

This is what i want to be removed.

enter image description here

Thanks.

3 Answers 3

3

There are several plugins that can do that:

  1. Adminimize, you can remove it even on role base
  2. Admin Trim Menu
0
31

No need to use one or two plugins for such small task...

To remove the Help Tab use

add_filter( 'contextual_help', 'mytheme_remove_help_tabs', 999, 3 );
function mytheme_remove_help_tabs($old_help, $screen_id, $screen){
    $screen->remove_help_tabs();
    return $old_help;
}

Or

add_action('admin_head', 'mytheme_remove_help_tabs');
function mytheme_remove_help_tabs() {
    $screen = get_current_screen();
    $screen->remove_help_tabs();
}

Where the first one is the safe one

And to remove the Screen Options Tab

add_filter('screen_options_show_screen', '__return_false');

You can use this on tour functions.php file or as part of a custom plugin.

<?php
/*
Plugin Name: Remove Tabs
Plugin URI: http://www.exe.ie
Description: Remove Help Tab and Screen Options Tab
Author: Daniel Conde
Author URI: http://www.exe.ie
*/

/* It will remove the tabs, not hide them with CSS */

add_filter( 'contextual_help', 'mytheme_remove_help_tabs', 999, 3 );
function mytheme_remove_help_tabs($old_help, $screen_id, $screen){
    $screen->remove_help_tabs();
    return $old_help;
}

add_filter('screen_options_show_screen', '__return_false');
?>

Copy and save as removetabs.php, upload to your plugins folder and activate.

Edit: I realize that by using add_filter('screen_options_show_screen', '__return_false'); you loose any settings previously configured on the "Screen Tab" for example on the dashboard, instead of two columns of widgets you will only get one. To avoid this or if you are experiencing the problem of loosing the settings on the "Screen Tab" you can use this instead:

Replace: add_filter('screen_options_show_screen', '__return_false');

With:

function remove_screen_options($display_boolean, $wp_screen_object){
  $blacklist = array('post.php', 'post-new.php', 'index.php', 'edit.php');
  if (in_array($GLOBALS['pagenow'], $blacklist)) {
    $wp_screen_object->render_screen_layout();
    $wp_screen_object->render_per_page_options();
    return false;
  } else {
    return true;
  }
}
add_filter('screen_options_show_screen', 'remove_screen_options', 10, 2);

Settings/options saved on the "Screen Tab" will not be lost, and the tab will be gone for the pages on the $blacklist array, You can add more pages to the list or remove the if(in_array statment

0

Hide specific screen setting (in this case Woocommerce download option).

add_filter( 'screen_settings', function ( $screen_settings, $screen ) {
 global $wp_meta_boxes;
 unset($wp_meta_boxes['shop_order']['normal']['default']['woocommerce-order-downloads']);
}, 10, 2 );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.