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

---

# get_page( int|WP_Post $page, string $output = OBJECT, string $filter ): 󠀁[WP_Post](https://developer.wordpress.org/reference/classes/wp_post/)󠁿|array|null

## In this article

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

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

This function has been deprecated since 3.5.0. Use get_post() instead.

Retrieves page data given a page ID or page object.

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

Use [get_post()](https://developer.wordpress.org/reference/functions/get_post/) 
instead of [get_page()](https://developer.wordpress.org/reference/functions/get_page/).

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

 `$page`int|[WP_Post](https://developer.wordpress.org/reference/classes/wp_post/)
required

Page object or page ID. Passed by reference.

`$output`stringoptional

The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which correspond to
a [WP_Post](https://developer.wordpress.org/reference/classes/wp_post/) object, 
an associative array, or a numeric array, respectively.

Default:`OBJECT`

`$filter`stringoptional

How the return value should be filtered. Accepts `'raw'`, `'edit'`, `'db'`, `'display'`.
Default `'raw'`.

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

 [WP_Post](https://developer.wordpress.org/reference/classes/wp_post/)|array|null
[WP_Post](https://developer.wordpress.org/reference/classes/wp_post/) or array on
success, null on failure.

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

    ```php
    function get_page( $page, $output = OBJECT, $filter = 'raw' ) {
    	return get_post( $page, $output, $filter );
    }
    ```

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

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

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

Retrieves post data given a post ID or post object.

  |

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

| Version | Description | 
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Deprecated. Use [get_post()](https://developer.wordpress.org/reference/functions/get_post/)  | 
| [1.5.1](https://developer.wordpress.org/reference/since/1.5.1/) | Introduced. |

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

 1.  [Skip to note 2 content](https://developer.wordpress.org/reference/functions/get_page/?output_format=md#comment-content-2376)
 2.   [thomasmaier](https://profiles.wordpress.org/thomasmaier/)  [  9 years ago  ](https://developer.wordpress.org/reference/functions/get_page/#comment-2376)
 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%2Fget_page%2F%23comment-2376)
    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%2Fget_page%2F%23comment-2376)
 4. Add the content of a page anywhere with separated title.
 5.     ```php
        $id = 0; // add the ID of the page where the zero is
        $p = get_page($id);
        $t = $p->post_title;
        echo '<h3>'.apply_filters('post_title', $t).'</h3>'; // the title is here wrapped with h3
        echo apply_filters('the_content', $p->post_content);
        ```
    
 6.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_page%2F%3Freplytocom%3D2376%23feedback-editor-2376)

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