wp_delete_post( int $postid, bool $force_delete = false )

Trash or delete a post or page.


25 related functions found for: wp_delete_post

Top ↑

Related terms found for this post

TaxonomyTerms
wp-parser-related-wordsdelet, delete, post, post-php, post-typ, post-type, wp-delete, wp-includes
wp-parser-packagePost, WordPress
wp-parser-source-filewp-includes/post.php

Top ↑

Terms Used Terms Used

Terms used in the related posts query

  • delet
  • delete
  • post
  • Post
  • post-php
  • post-typ
  • post-type
  • wp-delete
  • wp-includes
  • wp-includes/post.php

Top ↑

Description Description

When the post and page is permanently deleted, everything that is tied to it is deleted also. This includes comments, post meta fields, and terms associated with the post.

The post or page is moved to trash instead of permanently deleted unless trash is disabled, item is already in the trash, or $force_delete is true.


Top ↑

Parameters Parameters

$postid

(int) (Optional) Post ID. Default 0.

$force_delete

(bool) (Optional) Whether to bypass trash and force deletion.

Default value: false


Top ↑

Return Return

(array|false|WP_Post) False on failure.


Top ↑

Source Source

File: wp-includes/post.php


			

Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.