Title: delete_post_{$post-&gt;post_type}
Published: July 16, 2024
Last modified: February 24, 2026

---

# do_action( “delete_post_{$post->post_type}”, int $post_id, WP_Post $post )

## In this article

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

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

Fires immediately before a post is deleted from the database.

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

The dynamic portion of the hook name, `$post->post_type`, refers to the post type
slug.

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

 `$post_id`int

Post ID.

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

Post object.

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

    ```php
    do_action( "delete_post_{$post->post_type}", $post_id, $post );
    ```

[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#L3896)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/post.php#L3896-L3896)

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

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

Trashes or deletes a post or page.

  |

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

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

## User Contributed Notes

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