Yes, by adding an action to the before_delete_post, delete_post, or deleted_post actions.
Related Posts:
- delete post also attachments
- Allow role to delete posts but block him the wp-admin
- Why does `url_to_postid` return 0 when testing `page_for_posts` Page?
- Delete Post From Front-End and attachment permanently
- disable Tab post on nav-menus page (Admin)
- Format latest/newest post differently
- Optimize CPT-function with a loop
- Help on conditional statement to accompany wp_insert_post function please?
- How to put the author of the post in the comments?
- Alt text attributes not showing over portfolio images
- How to add a custom class attribute into code wrapper? [duplicate]
- How to change the case of all post titles to “Title Case”
- Function to execute when a post is moved to trash .
- How to display by default only published posts/pages in the admin area?
- Post/Page Preview Template
- using wp_update_post on save_post
- Replace image attributes for lazyload plugin (data-src)
- WordPress plugin to publish to multiple remote WordPress blogs
- Any way to create a revision of a post ONLY with a new button in the Meta Box?
- How to display comments and comment form on custom post type?
- Code to auto expire posts after 30 days
- How to wrap every image in a post with a div?
- Show One Category on Post
- Custom colors for post rows based on post meta value
- How to add an admin function only to posts, not pages?
- WordPress Delete hook with wp_delete_post function?
- Custom post type single (permalink) throws a 404 error
- Order post by year DESC and month ASC
- Custom wp_trim_words() function not trimming right
- Do I use custom post type or something else?
- Limit function to specific post category
- Custom post type permalinks breaking due to 3.1 bug fix
- When paginating a Page with the tag, how can the 2nd and subsequent page styles be customised?
- Function to show random posts from a category
- ‘Invalid post type’ error when importing from one site to another
- Blogroll – Different layout for first post
- How to delete old posts’ edits to save space?
- Checking is user author of number of posts?
- Create cron job without a plugin?
- Remove slashes (both before and after) in relative post url
- How to rename “Publish” metabox title in post screen
- Add icon/badge next to posttitle of specific category
- Edit custom post type admin menu link
- Converting a dynamic piece of code using WordPress Loop into a static one using Post ID
- How to include a post type in the admin/backend?
- Get posts of ONE taxonomy term of custom post type
- WordPress Custom Fields (Checkboxes with multiple values)
- Using custom post template
- Custom Post Archive Page not working
- Adding custom fields to bbpress reply form
- Adding buttons to Add New Post and Add New Page
- Show the content that is after the excerpt using child theme
- How to allow users to post only in certain category and hide elements from edit page?
- Editing the default page to show all posts, rather than most recent ones
- Permission issue with custom post type – not added to menu – by plugin
- Remove Custom Post Type Slug and add Custom Taxonomy to Permalink Structure?
- Order posts alphabetically: how to set order=asc in mysql query?
- Is it possible to customize the post according to post format in single.php?
- Post type no single page
- Adding a user’s ID behind the tag ref link address
- How to check in functions.php if there is data in a WP_Query?
- Display the 2nd category name of a custom post type without error if its null?
- Get post by tag
- Querying another post category to match current post and display in loop
- datepicker value in mysql
- Query function not executed between element [closed]
- Simple Custom Metabox Not Saving
- How to restore deleted post related with deleted users
- WordPress as CMS: How to manage/handle images assigned to a post as full-sized background images in a slideshow?
- Custom Post Type Single Loop Outputting Wrong Post
- WordPress Post Deletion Issue
- How Can I Always Display A Particular Post First Using WP_Query?
- MySQL: Possible to replace all of wp_posts.post_content(id#) via UPDATE + REPLACE + SELECT?
- Change modified date to current date when title updated automatically
- Check if almost 10 year old – working code is up to date
- Redirecting wordpress search query to archive page
- How to create custom search form function including post “tags”
- Remove pagination if search returns empty
- Remove HTML tags from all posts
- Please I want to prefix my WP posts title according to each category
- Save All Post Permalink From A Specific Category into a .txt file
- How to Display Most View Post in the template file?
- Customizing URL slugs of Custom Post Type and Taxonomy make posts/pages 404
- Show post excerpt
- How do I apply a wordpress function to something with no ID inside an archive page?
- Show author bio box
- Check if user has avatar
- How to retrieve custom field values and save again as array
- Call image from post on index page?
- Is there a Standard Format for Clean URLs for Archives of Custom Posts?
- How do I get thumbnails?
- Run function after post is updated
- Checking if some condition is matched before inserting post into database
- fire action when post is being edited as well as saved?
- adding custom meta as well as looping through posts
- Notify Author of the post if admin deletes his post and perform some function
- How remove “recent comments” title without modifying code? [closed]
- Dynamic Menu Item
- I have a website issue I am trying to resolve
- How to sort posts alphabetically based on a specific parent category