WordPress at a glance

delete_post_thumbnail() WP 1.0

Remove a post thumbnail.

No Hooks.


true/false. True on success, false on failure.


delete_post_thumbnail( $post );
$post(int/WP_Post) (required)
Post ID or post object from which the thumbnail should be removed.


Since 3.3.0 Introduced.

Code of delete post thumbnail: wp-includes/post.php WP 5.4.2

function delete_post_thumbnail( $post ) {
	$post = get_post( $post );
	if ( $post ) {
		return delete_post_meta( $post->ID, '_thumbnail_id' );
	return false;

Related Functions

From tag: Thumbnail (images)

More from category: Thumbnails

No comments
        Log In . Register