Title: wp_untrash_post_status
Published: December 9, 2020
Last modified: May 20, 2026

---

# apply_filters( ‘wp_untrash_post_status’, string $new_status, int $post_id, string $previous_status )

## In this article

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

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

Filters the status that a post gets assigned when it is restored from the trash (
untrashed).

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

By default posts that are restored will be assigned a status of ‘draft’. Return 
the value of `$previous_status` in order to assign the status that the post had 
before it was trashed. The `wp_untrash_post_set_previous_status()` function is available
for this.

Prior to WordPress 5.6.0, restored posts were always assigned their original status.

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

 `$new_status`string

The new status of the post being restored.

`$post_id`int

The ID of the post being restored.

`$previous_status`string

The status of the post at the point where it was trashed.

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

    ```php
    $post_status = apply_filters( 'wp_untrash_post_status', $new_status, $post_id, $previous_status );
    ```

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

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

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

Restores a post from the Trash.

  |

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

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

## User Contributed Notes

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