6

Is there any way to remove the help tabs? I'm looking to remove these tabs not to hide them with CSS.

On the wp-admin/includes/screen.php there are a couple of lines that mention this but no idea how to create something to remove the help tab.

Is there any way to create something similar to: add_filter('screen_options_show_screen', '__return_false'); but to remove the Help tab ?

From the screen.php file:

 647      /**
 648       * Removes a help tab from the contextual help for the screen.
 649       *
 650       * @since 3.3.0
 651       *
 652       * @param string $id The help tab ID.
 653       */
 654    public function remove_help_tab( $id ) {
 655          unset( $this->_help_tabs[ $id ] );
 656      }
 657  
 658      /**
 659       * Removes all help tabs from the contextual help for the screen.
 660       *
 661       * @since 3.3.0
 662       */
 663    public function remove_help_tabs() {
 664          $this->_help_tabs = array();
 665      }

2 Answers 2

8

You need to use the contextual_help help filter.

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

The filter is for the old context help (pre 3.3). (I'm not sure it matters what is returned...?).

In any case the filter should be called late (hence 999) because plug-ins could add their own help tabs to pages. This is partly why admin_head is not an ideal hook.

1
  • 2
    As stated here the contextual_help has since been depreciated. Commented Jan 14, 2017 at 8:23
9

Add this you your functions.php file:

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

This will remove tabs ant the 'Help' button from all admin pages.

Your Answer

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

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