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

---

# add_users_page( string $page_title, string $menu_title, string $capability, string $menu_slug, callable $callback = '', int $position = null ): string|false

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/add_users_page/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/functions/add_users_page/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/add_users_page/?output_format=md#return)
 * [More Information](https://developer.wordpress.org/reference/functions/add_users_page/?output_format=md#more-information)
 * [Source](https://developer.wordpress.org/reference/functions/add_users_page/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/add_users_page/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/add_users_page/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/functions/add_users_page/?output_format=md#user-contributed-notes)

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

Adds a submenu page to the Users/Profile main menu.

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

This function takes a capability which will be used to determine whether or not 
a page is included in the menu.

The function which is hooked in to handle the output of the page must check that
the user has the required capability as well.

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

 `$page_title`stringrequired

The text to be displayed in the title tags of the page when the menu is selected.

`$menu_title`stringrequired

The text to be used for the menu.

`$capability`stringrequired

The capability required for this menu to be displayed to the user.

`$menu_slug`stringrequired

The slug name to refer to this menu by (should be unique for this menu).

`$callback`callableoptional

The function to be called to output the content for this page.

Default:`''`

`$position`intoptional

The position in the menu order this item should appear.

Default:`null`

## 󠀁[Return](https://developer.wordpress.org/reference/functions/add_users_page/?output_format=md#return)󠁿

 string|false The resulting page’s hook_suffix, or false if the user does not have
the capability required.

## 󠀁[More Information](https://developer.wordpress.org/reference/functions/add_users_page/?output_format=md#more-information)󠁿

 * NOTE: If you’re running into the »_You do not have sufficient permissions to 
   access this page._« message in a `[wp_die()](https://developer.wordpress.org/reference/functions/wp_die/)`
   screen, then you’ve hooked too early. The hook you should use is `admin_menu`.
 * This function is a simple wrapper for a call to [add_submenu_page()](https://developer.wordpress.org/reference/functions/add_submenu_page/),
   passing the received arguments and specifying ‘`users.php`‘ or ‘`profile.php`‘(
   depending upon the users’ capability) as the `$parent_slug` argument. This means
   the new page will be added as a sub-menu to the _Users_ or _Profile_ menu.
 * The _Users_ menu is only available to users with the ability to edit other users.
   Users with capability below this level will see a _Profile_ menu instead.

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

    ```php
    function add_users_page( $page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = null ) {
    	if ( current_user_can( 'edit_users' ) ) {
    		$parent = 'users.php';
    	} else {
    		$parent = 'profile.php';
    	}
    	return add_submenu_page( $parent, $page_title, $menu_title, $capability, $menu_slug, $callback, $position );
    }
    ```

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

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

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

Adds a submenu page.

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

Returns whether the current user has the specified capability.

  |

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

| Version | Description | 
| [5.3.0](https://developer.wordpress.org/reference/since/5.3.0/) | Added the `$position` parameter. | 
| [2.1.3](https://developer.wordpress.org/reference/since/2.1.3/) | Introduced. |

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

 1.  [Skip to note 2 content](https://developer.wordpress.org/reference/functions/add_users_page/?output_format=md#comment-content-1250)
 2.   [Codex](https://profiles.wordpress.org/codex/)  [  10 years ago  ](https://developer.wordpress.org/reference/functions/add_users_page/#comment-1250)
 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%2Ffunctions%2Fadd_users_page%2F%23comment-1250)
    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%2Ffunctions%2Fadd_users_page%2F%23comment-1250)
 4. **Basic Example**
 5. Typical usage occurs in a function registered with the ‘[admin_menu](https://developer.wordpress.org/reference/hooks/admin_menu/)‘
    hook (see [Adding Administration Menus](https://developer.wordpress.org/themes/functionality/administration-menus/)):
 6.     ```php
        /**
         * Register a new page under "Users".
         */
        function wpdocs_my_users_menu() {
        	add_users_page(
        		__( 'My Plugin Users', 'textdomain' ),
        		__( 'My Plugin', 'textdomain' ),
        		'read',
        		'my-unique-identifier',
        		'my_plugin_function'
        	);
        }
        add_action('admin_menu', 'wpdocs_my_users_menu');
        ```
    
 7.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fadd_users_page%2F%3Freplytocom%3D1250%23feedback-editor-1250)

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