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

---

# apply_filters( ‘wp_page_menu_args’, array $args )

## In this article

 * [Description](https://developer.wordpress.org/reference/hooks/wp_page_menu_args/?output_format=md#description)
    - [See also](https://developer.wordpress.org/reference/hooks/wp_page_menu_args/?output_format=md#see-also)
 * [Parameters](https://developer.wordpress.org/reference/hooks/wp_page_menu_args/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/wp_page_menu_args/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/wp_page_menu_args/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/wp_page_menu_args/?output_format=md#changelog)

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

Filters the arguments used to generate a page-based menu.

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

### 󠀁[See also](https://developer.wordpress.org/reference/hooks/wp_page_menu_args/?output_format=md#see-also)󠁿

 * [wp_page_menu()](https://developer.wordpress.org/reference/functions/wp_page_menu/)

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

 `$args`array

An array of page menu arguments. See [wp_page_menu()](https://developer.wordpress.org/reference/functions/wp_page_menu/)
for information on accepted arguments.

More Arguments from wp_page_menu( … $args )

Array or string of arguments to retrieve pages.

 * `child_of` int
 * Page ID to return child and grandchild pages of. Note: The value of `$hierarchical`
   has no bearing on whether `$child_of` returns hierarchical results. Default 0,
   or no restriction.
 * `sort_order` string
 * How to sort retrieved pages. Accepts `'ASC'`, `'DESC'`. Default `'ASC'`.
 * `sort_column` string
 * What columns to sort pages by, comma-separated. Accepts `'post_author'`, `'post_date'`,`'
   post_title'`, `'post_name'`, `'post_modified'`, `'menu_order'`, `'post_modified_gmt'`,`'
   post_parent'`, `'ID'`, `'rand'`, `'comment*count'`.
    `'post*'` can be omitted
   for any values that start with it. Default `'post_title'`.
 * `hierarchical` bool
 * Whether to return pages hierarchically. If false in conjunction with `$child_of`
   also being false, both arguments will be disregarded.
    Default true.
 * `exclude` int[]
 * Array of page IDs to exclude.
 * `include` int[]
 * Array of page IDs to include. Cannot be used with `$child_of`, `$parent`, `$exclude`,`
   $meta_key`, `$meta_value`, or `$hierarchical`.
 * `meta_key` string
 * Only include pages with this meta key.
 * `meta_value` string
 * Only include pages with this meta value. Requires `$meta_key`.
 * `authors` string
 * A comma-separated list of author IDs.
 * `parent` int
 * Page ID to return direct children of. Default -1, or no restriction.
 * `exclude_tree` string|int[]
 * Comma-separated string or array of page IDs to exclude.
 * `number` int
 * The number of pages to return. Default 0, or all pages.
 * `offset` int
 * The number of pages to skip before returning. Requires `$number`.
    Default 0.
 * `post_type` string
 * The post type to query. Default `'page'`.
 * `post_status` string|array
 * A comma-separated list or array of post statuses to include.
    Default `'publish'`.

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

    ```php
    $args = apply_filters( 'wp_page_menu_args', $args );
    ```

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

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

| Used by | Description | 
| [wp_page_menu()](https://developer.wordpress.org/reference/functions/wp_page_menu/)`wp-includes/post-template.php` |

Displays or retrieves a list of pages with an optional home link.

  |

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

| Version | Description | 
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |

## User Contributed Notes

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