Title: pre_untrash_post
Published: November 20, 2017
Last modified: May 20, 2026

---

# apply_filters( ‘pre_untrash_post’, bool|null $untrash, WP_Post $post, string $previous_status )

## In this article

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

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

Filters whether a post untrashing should take place.

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

 `$untrash`bool|null

Whether to go forward with untrashing.

`$post`[WP_Post](https://developer.wordpress.org/reference/classes/wp_post/)

Post object.

`$previous_status`string

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

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

    ```php
    $check = apply_filters( 'pre_untrash_post', null, $post, $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#L4115)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/post.php#L4115-L4115)

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

| Version | Description | 
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Added the `$previous_status` parameter. | 
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |

## User Contributed Notes

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