Title: WP_Screen::add_help_tab
Published: April 25, 2014
Last modified: May 20, 2026

---

# WP_Screen::add_help_tab( array $args )

## In this article

 * [Description](https://developer.wordpress.org/reference/classes/WP_Screen/add_help_tab/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/classes/WP_Screen/add_help_tab/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/classes/WP_Screen/add_help_tab/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/WP_Screen/add_help_tab/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/WP_Screen/add_help_tab/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/classes/WP_Screen/add_help_tab/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/classes/WP_Screen/add_help_tab/?output_format=md#wp--skip-link--target)

Adds a help tab to the contextual help for the screen.

## 󠀁[Description](https://developer.wordpress.org/reference/classes/WP_Screen/add_help_tab/?output_format=md#description)󠁿

Call this on the `load-$pagenow` hook for the relevant screen, or fetch the `$current_screen`
object, or use [get_current_screen()](https://developer.wordpress.org/reference/functions/get_current_screen/)
and then call the method from the object.

You may need to filter `$current_screen` using an if or switch statement to prevent
new help tabs from being added to ALL admin screens.

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/WP_Screen/add_help_tab/?output_format=md#parameters)󠁿

 `$args`arrayrequired

Array of arguments used to display the help tab.

 * `title` string
 * Title for the tab. Default false.
 * `id` string
 * Tab ID. Must be HTML-safe and should be unique for this menu.
    It is NOT allowed
   to contain any empty spaces. Default false.
 * `content` string
 * Optional. Help tab content in plain text or HTML. Default empty string.
 * `callback` callable
 * Optional. A callback to generate the tab content. Default false.
 * `priority` int
 * Optional. The priority of the tab, used for ordering. Default 10.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/WP_Screen/add_help_tab/?output_format=md#source)󠁿

    ```php
    public function add_help_tab( $args ) {
    	$defaults = array(
    		'title'    => false,
    		'id'       => false,
    		'content'  => '',
    		'callback' => false,
    		'priority' => 10,
    	);
    	$args     = wp_parse_args( $args, $defaults );

    	$args['id'] = sanitize_html_class( $args['id'] );

    	// Ensure we have an ID and title.
    	if ( ! $args['id'] || ! $args['title'] ) {
    		return;
    	}

    	// Allows for overriding an existing tab with that ID.
    	$this->_help_tabs[ $args['id'] ] = $args;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-screen.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-admin/includes/class-wp-screen.php#L633)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-admin/includes/class-wp-screen.php#L633-L652)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/WP_Screen/add_help_tab/?output_format=md#related)󠁿

| Uses | Description | 
| [sanitize_html_class()](https://developer.wordpress.org/reference/functions/sanitize_html_class/)`wp-includes/formatting.php` |

Sanitizes an HTML classname to ensure it only contains valid characters.

  | 
| [wp_parse_args()](https://developer.wordpress.org/reference/functions/wp_parse_args/)`wp-includes/functions.php` |

Merges user defined arguments into defaults array.

  |

| Used by | Description | 
| [WP_Screen::render_screen_meta()](https://developer.wordpress.org/reference/classes/wp_screen/render_screen_meta/)`wp-admin/includes/class-wp-screen.php` |

Renders the screen’s help section.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/WP_Screen/add_help_tab/?output_format=md#changelog)󠁿

| Version | Description | 
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | The `$priority` argument was added. | 
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/classes/WP_Screen/add_help_tab/?output_format=md#user-contributed-notes)󠁿

 1.   [Skip to note 5 content](https://developer.wordpress.org/reference/classes/WP_Screen/add_help_tab/?output_format=md#comment-content-3427)
 2.    [Akira Tachibana](https://profiles.wordpress.org/atachibana/)  [  7 years ago  ](https://developer.wordpress.org/reference/classes/wp_screen/add_help_tab/#comment-3427)
 3.  [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_screen%2Fadd_help_tab%2F%23comment-3427)
     Vote results for this note: 1[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_screen%2Fadd_help_tab%2F%23comment-3427)
 4.  This is from Codex Usage.
      This example shows how you would add contextual help
     to an admin page you’ve created with the [add_options_page()](https://developer.wordpress.org/reference/functions/add_options_page/)
     function. Here, we assume that your admin page has a slug of ‘my_admin_page’ and
     exists under the Options tab.
 5.      ```php
         <?php 
         add_action( 'admin_menu', 'my_admin_add_page' );
         function my_admin_add_page() {
             $my_admin_page = add_options_page( __( 'My Admin Page', 'map' ), __('My Admin Page', 'map'), 'manage_options', 'map', 'my_admin_page' );
     
             // Adds my_help_tab when my_admin_page loads
             add_action( 'load-'.$my_admin_page, 'my_admin_add_help_tab' );
         }
     
         function my_admin_add_help_tab () {
             $screen = get_current_screen();
     
             // Add my_help_tab if current screen is My Admin Page
             $screen->add_help_tab( array(
                 'id'	=> 'my_help_tab',
                 'title'	=> __('My Help Tab'),
                 'content'	=> '<p>' . __( 'Descriptive content that will show in My Help Tab-body goes here.' ) . '</p>',
             ) );
         }
         ?>
         ```
     
 6.   [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_screen%2Fadd_help_tab%2F%3Freplytocom%3D3427%23feedback-editor-3427)
 7.   [Skip to note 6 content](https://developer.wordpress.org/reference/classes/WP_Screen/add_help_tab/?output_format=md#comment-content-3428)
 8.    [Akira Tachibana](https://profiles.wordpress.org/atachibana/)  [  7 years ago  ](https://developer.wordpress.org/reference/classes/wp_screen/add_help_tab/#comment-3428)
 9.  [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_screen%2Fadd_help_tab%2F%23comment-3428)
     Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_screen%2Fadd_help_tab%2F%23comment-3428)
 10. This is from Codex Usage.
      Advanced Usage (from within a class)
 11.     ```php
             <?php
         /**
          * Plugin Name: Help Tab Test Case
          * Plugin URI:  http://unserkaiser.com
          * Description: Add Help Tab test case
          */
         class example_help
         {
         	public $tabs = array(
         		// The assoc key represents the ID
         		// It is NOT allowed to contain spaces
         		 'EXAMPLE' => array(
         		 	 'title'   => 'TEST ME!'
         		 	,'content' => 'FOO'
         		 )
         	);
     
         	static public function init()
         	{
         		$class = __CLASS__ ;
         		new $class;
         	}
     
         	public function __construct()
         	{
         		add_action( "load-{$GLOBALS['pagenow']}", array( $this, 'add_tabs' ), 20 );
         	}
     
         	public function add_tabs()
         	{
         		foreach ( $this->tabs as $id => $data )
         		{
         			get_current_screen()->add_help_tab( array(
         				 'id'       => $id
         				,'title'    => __( $data['title'], 'some_textdomain' )
         				// Use the content only if you want to add something
         				// static on every help tab. Example: Another title inside the tab
         				,'content'  => '<p>Some stuff that stays above every help text</p>'
         				,'callback' => array( $this, 'prepare' )
         			) );
         		}
         	}
     
         	public function prepare( $screen, $tab )
         	    {
         	    	printf( 
         			 '<p>%s</p>'
         			,__( 
         	    			 $tab['callback'][0]->tabs[ $tab['id'] ]['content']
         				,'dmb_textdomain' 
         			 )
         		);
         	}
         }
         // Always add help tabs during "load-{$GLOBALS['pagenow'}".
         // There're some edge cases, as for example on reading options screen, your
         // Help Tabs get loaded before the built in tabs. This seems to be a core error.
         add_action( 'load-post.php', array( 'example_help', 'init' ) );
         add_action( 'load-post-new.php', array( 'example_help', 'init' ) );
         ```
     
 12. Above example came out of a [WPSE question](http://wordpress.stackexchange.com/questions/53595/help-tabs-with-add-help-tab-callback-how-does-the-argument-work/53598#53598).
     
     You can read [this WPSE question](http://wordpress.stackexchange.com/questions/45210/positioning-screen-contextual-help-tabs)
     about how to fix the wrong order bug without changing core code.
 13.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_screen%2Fadd_help_tab%2F%3Freplytocom%3D3428%23feedback-editor-3428)
 14.  [Skip to note 7 content](https://developer.wordpress.org/reference/classes/WP_Screen/add_help_tab/?output_format=md#comment-content-3429)
 15.   [Akira Tachibana](https://profiles.wordpress.org/atachibana/)  [  7 years ago  ](https://developer.wordpress.org/reference/classes/wp_screen/add_help_tab/#comment-3429)
 16. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_screen%2Fadd_help_tab%2F%23comment-3429)
     Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_screen%2Fadd_help_tab%2F%23comment-3429)
 17. This is from Codex Usage.
      Basic Usage.
 18.     ```php
          <?php
         $screen = get_current_screen();
         $screen->add_help_tab( array( 
            'id' => $id,            //unique id for the tab
            'title' => $title,      //unique visible title for the tab
            'content' => $content,  //actual help text
            'callback' => $callback //optional function to callback
         ) );
         ?> 
         ```
     
 19.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_screen%2Fadd_help_tab%2F%3Freplytocom%3D3429%23feedback-editor-3429)
 20.  [Skip to note 8 content](https://developer.wordpress.org/reference/classes/WP_Screen/add_help_tab/?output_format=md#comment-content-1987)
 21.   [Pratik Shrestha](https://profiles.wordpress.org/pratikshrestha/)  [  9 years ago  ](https://developer.wordpress.org/reference/classes/wp_screen/add_help_tab/#comment-1987)
 22. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_screen%2Fadd_help_tab%2F%23comment-1987)
     Vote results for this note: -2[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_screen%2Fadd_help_tab%2F%23comment-1987)
 23.     ```php
         add_filter( 'contextual_help', 'my_admin_help', 5, 3 );
         function my_admin_help( $old_help, $screen_id, $screen ) {
         	// Not our screen, exit earlier
             if( 'my-admin' != $screen_id ) {
                 return;
             }
     
             // Add one help tab
             $screen->add_help_tab( array(
                 'id'      => 'my-admin-help',
                 'title'   => esc_html__( 'My Help Tab', 'my-text-domain' ),
                 'content' => '<p>' . esc_html__( 'Descriptive content that will show in My Help Tab-body goes here.', 'my-text-domain' ) . '</p>',
         		// Use 'callback' to use callback function to display tab content
             ) );
     
             // This sets the sidebar for help screen, if required
             get_current_screen()->set_help_sidebar(
                 '<p><strong>' . esc_html__( 'For more information:', 'my-text-domain' ) . '</strong></p>' .
                 '<p><a href="https://wordpress.org/">WordPress</a></p&gt;' .
                 '<p><a href="https://wordpress.org/support/&quot; target="_blank">' . esc_html__( 'Support Forums', 'my-text-domain' ) . '</a></p>'
             );
     
             return $old_help;
         }
         ```
     
 24.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_screen%2Fadd_help_tab%2F%3Freplytocom%3D1987%23feedback-editor-1987)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_screen%2Fadd_help_tab%2F)
before being able to contribute a note or feedback.