Title: add_posts_page
Published: April 25, 2014
Last modified: February 24, 2026

---

# add_posts_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_posts_page/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/functions/add_posts_page/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/add_posts_page/?output_format=md#return)
 * [More Information](https://developer.wordpress.org/reference/functions/add_posts_page/?output_format=md#more-information)
 * [Source](https://developer.wordpress.org/reference/functions/add_posts_page/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/add_posts_page/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/add_posts_page/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/functions/add_posts_page/?output_format=md#user-contributed-notes)

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

Adds a submenu page to the Posts main menu.

## 󠀁[Description](https://developer.wordpress.org/reference/functions/add_posts_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_posts_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.

`$position`intoptional

The position in the menu order this item should appear.

Default:`null`

## 󠀁[Return](https://developer.wordpress.org/reference/functions/add_posts_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_posts_page/?output_format=md#more-information)󠁿

 * 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 ‘`edit.php`‘ as the `$parent_slug`
   argument. This means the new page will be added as a sub menu to the `Posts` 
   menu.
 * The `$capability` parameter is used to determine whether or not the page is included
   in the menu based on the [Roles and Capabilities](https://wordpress.org/support/article/roles-and-capabilities/))
   of the current user.
 * The function handling the output of the options page should also verify the user’s
   capabilities.
 * If you’re running into the »_You do not have sufficient permissions to access
   this page._« message in a ``wp_die()`` screen, then you’ve hooked too early. 
   The hook, you should use is `[admin_menu](https://developer.wordpress.org/reference/hooks/admin_menu/)`.

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

    ```php
    function add_posts_page( $page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = null ) {
    	return add_submenu_page( 'edit.php', $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/6.9.4/src/wp-admin/includes/plugin.php#L1748)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/plugin.php#L1748-L1750)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/add_posts_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.

  |

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

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

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

 1.  [Skip to note 2 content](https://developer.wordpress.org/reference/functions/add_posts_page/?output_format=md#comment-content-1280)
 2.   [Codex](https://profiles.wordpress.org/codex/)  [  10 years ago  ](https://developer.wordpress.org/reference/functions/add_posts_page/#comment-1280)
 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_posts_page%2F%23comment-1280)
    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_posts_page%2F%23comment-1280)
 4. **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
        /**
         * Adds a submenu item to the "Posts" menu in the admin.
         */
        function wpdocs_my_plugin_menu() {
        	add_posts_page(
        		__( 'My Plugin Posts Page', 'textdomain' ),
        		__( 'My Plugin', 'textdomain' ),
        		'read',
        		'my-unique-identifier',
        		'wpdocs_my_plugin_function'
        	);
        }
        add_action( 'admin_menu', 'wpdocs_my_plugin_menu');
        ```
    
 7.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fadd_posts_page%2F%3Freplytocom%3D1280%23feedback-editor-1280)

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