Found an elegant solution using [pre_delete_post](https://developer.wordpress.org/reference/hooks/pre_delete_post/): ``` function modify_pre_delete_post_defaults($delete, $post, $force_delete) { return true; } ``` This filters whether a post should be deleted. Returning any other value than $delete prevents deletion. See more info: - <https://wordpress.stackexchange.com/questions/224246/how-to-cancel-the-trash-action-inside-wp-trash-post> - <https://www.flippercode.com/wordpress/how-to-use-pre_delete_post-filter-in-wordpress/>