Codex tools: Log in / create account
Languages: English • Türkçe • (Add your language)
Contents |
Removes a post, attachment, or page.
When the post and page goes, everything that is tied to it is deleted also. This includes comments, post meta fields, and terms associated with the post.
<?php wp_delete_post( $postid, $force_delete = false ) ?>
Deleting WP default post "Hello World" which ID is '1'.
<?php wp_delete_post(1); ?>
Since: 1.0.0
wp_delete_post() is located in wp-includes/post.php.
wp_update_post(), wp_delete_attachment(), wp_get_attachment_url(), wp_insert_attachment(), wp_insert_post()