Block editor: Sandbox iframe shows outdated HTML

The WordPress (Gutenberg) block editor requests data from an oembed proxy endpoint, and that endpoint retrieves data using the Transients API. It seems that clearing all oembed caches doesn’t also clear oembed transient caches.

The following database query to clear your oembed caches from the postmeta table is NOT sufficient:

global $wpdb;
$meta_key_1 = "|_oembed|_%%";
$meta_key_2 = "|_oembed|_time|_%%";
$wpdb->query(
    $query = $wpdb->prepare( 
        "DELETE FROM `".$wpdb->postmeta."`
            WHERE `meta_key` LIKE %s ESCAPE '|'
            OR `meta_key` LIKE %s ESCAPE '|'",
        $meta_key_1,
        $meta_key_2
    )
);

You’ll also need to clear the transient caches from the options table, like so:

$option_name_1 = "|_transient|_oembed|_%%";
$option_name_2 = "|_transient|_timeout|_oembed|_%%";
$wpdb->query(
    $query = $wpdb->prepare( 
        "DELETE FROM `".$wpdb->options."`
            WHERE `option_name` LIKE %s ESCAPE '|'
            OR `option_name` LIKE %s ESCAPE '|'",
        $option_name_1,
        $option_name_2
    )
);