Title: add_options_page
Published: April 25, 2014
Last modified: August 20, 2026

---

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

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

Adds a submenu page to the Settings main menu.

## 󠀁[Description](https://developer.wordpress.org/reference/functions/add_options_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_options_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_options_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_options_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 ‘`options-general.php`‘ as the `
   $parent_slug` argument. This means the new options page will be added as a sub
   menu to the Settings 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 there are spaces in the `slug`, then these will be stripped out when the URL
   is generated. This will result in an error message telling you that you do not
   have sufficient permissions to view the page.

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

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

## 󠀁[Related](https://developer.wordpress.org/reference/functions/add_options_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_options_page/?output_format=md#changelog)󠁿

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

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

 1.   [Skip to note 4 content](https://developer.wordpress.org/reference/functions/add_options_page/?output_format=md#comment-content-1212)
 2.    [Codex](https://profiles.wordpress.org/codex/)  [  11 years ago  ](https://developer.wordpress.org/reference/functions/add_options_page/#comment-1212)
 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_options_page%2F%23comment-1212)
     Vote results for this note: 7[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_options_page%2F%23comment-1212)
 4.  **Object Oriented options page helper / view**
 5.      ```php
         /**
          * Class for registering a new settings page under Settings.
          */
         class WPDocs_Options_Page {
     
         	/**
         	 * Constructor.
         	 */
         	function __construct() {
         		add_action( 'admin_menu', array( $this, 'admin_menu' ) );
         	}
     
         	/**
         	 * Registers a new settings page under Settings.
         	 */
         	function admin_menu() {
         		add_options_page(
         			__( 'Page Title', 'textdomain' ),
         			__( 'Circle Tree Login', 'textdomain' ),
         			'manage_options',
         			'options_page_slug',
         			array(
         				$this,
         				'settings_page'
         			)
         		);
         	}
     
         	/**
         	 * Settings page display callback.
         	 */
         	function settings_page() {
         		echo __( 'This is the page content', 'textdomain' );
         	}
         }
     
         new WPDocs_Options_Page;
         ```
     
 6.   [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fadd_options_page%2F%3Freplytocom%3D1212%23feedback-editor-1212)
 7.   [Skip to note 5 content](https://developer.wordpress.org/reference/functions/add_options_page/?output_format=md#comment-content-1211)
 8.    [Codex](https://profiles.wordpress.org/codex/)  [  11 years ago  ](https://developer.wordpress.org/reference/functions/add_options_page/#comment-1211)
 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%2Ffunctions%2Fadd_options_page%2F%23comment-1211)
     Vote results for this note: 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_options_page%2F%23comment-1211)
 10. **Basic Example**
 11. Typical usage occurs in a function registered with the ‘admin_menu’ hook (see 
     Adding Administration Menus):
 12.     ```php
         /**
          * Registers a new options page under Settings.
          */
         function wpdocs_my_plugin_menu() {
         	add_options_page( 
         		__( 'My Options', 'textdomain' ),
         		__( 'My Plugin', 'textdomain' ),
         		'manage_options',
         		'my-plugin.php',
         		'my_plugin_page'
         	);
         }
         ```
     
 13.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fadd_options_page%2F%3Freplytocom%3D1211%23feedback-editor-1211)
 14.  [Skip to note 6 content](https://developer.wordpress.org/reference/functions/add_options_page/?output_format=md#comment-content-5690)
 15.   [Dave](https://profiles.wordpress.org/drandlomb/)  [  5 years ago  ](https://developer.wordpress.org/reference/functions/add_options_page/#comment-5690)
 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%2Ffunctions%2Fadd_options_page%2F%23comment-5690)
     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%2Ffunctions%2Fadd_options_page%2F%23comment-5690)
 17. Please hook this to _**admin\_menu**_ (not _admin\_init_ as seen in other articles
     on the web).
 18. Per the documentation for the wrapped [add_sub_menu_page()](https://developer.wordpress.org/reference/functions/add_submenu_page/):
 19. > 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](https://developer.wordpress.org/reference/hooks/admin_menu/).
 20.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fadd_options_page%2F%3Freplytocom%3D5690%23feedback-editor-5690)

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