Title: wp_get_single_post
Published: April 25, 2014
Last modified: April 28, 2025

---

# wp_get_single_post( int $postid, string $mode = OBJECT ): 󠀁[WP_Post](https://developer.wordpress.org/reference/classes/wp_post/)󠁿|null

## In this article

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

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

This function has been deprecated since 3.5.0. Use [get_post()](https://developer.wordpress.org/reference/functions/get_post/)
instead.

Retrieve a single post, based on post ID.

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

Has categories in ‘post_category’ property or key. Has tags in ‘tags_input’ property
or key.

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

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

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

 `$postid`intrequired

Post ID.

`$mode`stringoptional

How to return result, either OBJECT, ARRAY_N, or ARRAY_A.

Default:`OBJECT`

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

 [WP_Post](https://developer.wordpress.org/reference/classes/wp_post/)|null Post
object or array holding post contents and information

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

    ```php
    function wp_get_single_post( $postid = 0, $mode = OBJECT ) {
    	_deprecated_function( __FUNCTION__, '3.5.0', 'get_post()' );
    	return get_post( $postid, $mode );
    }
    ```

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

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

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

Marks a function as deprecated and inform when it has been used.

  | 
| [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/wp_get_single_post/?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.0.0](https://developer.wordpress.org/reference/since/1.0.0/) | Introduced. |

## User Contributed Notes

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