delete_post_thumbnail

The timeline below displays how wordpress function delete_post_thumbnail has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 5.1

/**
 * Removes the thumbnail (featured image) from the given post.
 *
 * @since 3.3.0
 *
 * @param int|WP_Post $post Post ID or post object from which the thumbnail should be removed.
 * @return bool True on success, false on failure.
 */
function delete_post_thumbnail($post)
{
    $post = get_post($post);
    if ($post) {
        return delete_post_meta($post->ID, '_thumbnail_id');
    }
    return false;
}

WordPress Version: 4.0

/**
 * Remove a post thumbnail.
 *
 * @since 3.3.0
 *
 * @param int|WP_Post $post Post ID or post object where thumbnail should be removed from.
 * @return bool True on success, false on failure.
 */
function delete_post_thumbnail($post)
{
    $post = get_post($post);
    if ($post) {
        return delete_post_meta($post->ID, '_thumbnail_id');
    }
    return false;
}

WordPress Version: 3.9

/**
 * Removes a post thumbnail.
 *
 * @since 3.3.0
 *
 * @param int|WP_Post $post Post ID or post object where thumbnail should be removed from.
 * @return bool True on success, false on failure.
 */
function delete_post_thumbnail($post)
{
    $post = get_post($post);
    if ($post) {
        return delete_post_meta($post->ID, '_thumbnail_id');
    }
    return false;
}

WordPress Version: 3.7

/**
 * Removes a post thumbnail.
 *
 * @since 3.3.0
 *
 * @param int|object $post Post ID or object where thumbnail should be removed from.
 * @return bool True on success, false on failure.
 */
function delete_post_thumbnail($post)
{
    $post = get_post($post);
    if ($post) {
        return delete_post_meta($post->ID, '_thumbnail_id');
    }
    return false;
}