Title: add_trashed_suffix_to_trashed_posts
Published: April 1, 2020
Last modified: August 20, 2026

---

# apply_filters( ‘add_trashed_suffix_to_trashed_posts’, bool $add_trashed_suffix, string $post_name, int $post_id )

## In this article

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

Filters whether or not to add a `__trashed` suffix to the name of trashed posts 
that match the name of the updated post.

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

 `$add_trashed_suffix`bool

Whether to attempt to add the suffix.

`$post_name`string

The name of the post being updated.

`$post_id`int

Post ID.

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

    ```php
    $add_trashed_suffix = apply_filters( 'add_trashed_suffix_to_trashed_posts', true, $post_name, $post_id );
    ```

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

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

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

Inserts or updates a post in the database.

  |

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

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

## User Contributed Notes

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