{"id":5933,"date":"2026-02-12T20:45:59","date_gmt":"2026-02-13T01:45:59","guid":{"rendered":"https:\/\/chubes.net\/?documentation=wp-embed-cache"},"modified":"2026-02-15T16:08:59","modified_gmt":"2026-02-15T21:08:59","slug":"wp-embed-cache","status":"publish","type":"documentation","link":"https:\/\/chubes.net\/docs\/wp-cli\/embed\/wp-embed-cache\/","title":{"rendered":"wp embed cache"},"content":{"rendered":"<p>Finds, triggers, and deletes oEmbed caches.<\/p><h2 class=\"wp-block-heading\">Subcommands<\/h2><figure class=\"wp-block-table\"><table><thead><tr><th>Command<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>wp embed cache clear<\/td><td>Deletes all oEmbed caches for a given post.<\/td><\/tr><tr><td>wp embed cache find<\/td><td>Finds an oEmbed cache post ID for a given URL.<\/td><\/tr><tr><td>wp embed cache trigger<\/td><td>Triggers the caching of all oEmbed results for a given post.<\/td><\/tr><\/tbody><\/table><\/figure><h2 class=\"wp-block-heading\">wp embed cache clear<\/h2><p>Deletes all oEmbed caches for a given post.<\/p><p>oEmbed caches for a post are stored in the post&#8217;s metadata.<\/p><h3 class=\"wp-block-heading\">Synopsis<\/h3><div class=\"code-block-wrapper\"><div class=\"code-block-header\"><span class=\"code-block-language\">bash<\/span><button class=\"code-copy-btn\" aria-label=\"Copy code\"><svg><use href=\"https:\/\/chubes.net\/wp-content\/themes\/chubes\/assets\/icons\/chubes.svg#icon-copy\"><\/use><\/svg><\/button><\/div><pre data-chubes-enhanced class=\"wp-block-code language-bash\"><code class=\"language-bash\">wp embed cache clear &lt;post_id&gt;<\/code><\/pre><\/div><h3 class=\"wp-block-heading\">Options<\/h3><p><strong>&lt;post_id&gt;<\/strong>\n: ID of the post to clear the cache for.<\/p><h3 class=\"wp-block-heading\">Examples<\/h3><div class=\"code-block-wrapper\"><div class=\"code-block-header\"><span class=\"code-block-language\">bash<\/span><button class=\"code-copy-btn\" aria-label=\"Copy code\"><svg><use href=\"https:\/\/chubes.net\/wp-content\/themes\/chubes\/assets\/icons\/chubes.svg#icon-copy\"><\/use><\/svg><\/button><\/div><pre data-chubes-enhanced class=\"wp-block-code language-bash\"><code class=\"language-bash\"># Clear cache for a post\n$ wp embed cache clear 123\nSuccess: Cleared oEmbed cache.<\/code><\/pre><\/div><h2 class=\"wp-block-heading\">wp embed cache find<\/h2><p>Finds an oEmbed cache post ID for a given URL.<\/p><p>Starting with WordPress 4.9, embeds that aren&#8217;t associated with a specific post will be cached in a new oembed_cache post type. There can be more than one such entry for a url depending on attributes and context.<\/p><h3 class=\"wp-block-heading\">Synopsis<\/h3><div class=\"code-block-wrapper\"><div class=\"code-block-header\"><span class=\"code-block-language\">bash<\/span><button class=\"code-copy-btn\" aria-label=\"Copy code\"><svg><use href=\"https:\/\/chubes.net\/wp-content\/themes\/chubes\/assets\/icons\/chubes.svg#icon-copy\"><\/use><\/svg><\/button><\/div><pre data-chubes-enhanced class=\"wp-block-code language-bash\"><code class=\"language-bash\">wp embed cache find &lt;url&gt; [--width=&lt;width&gt;] [--height=&lt;height&gt;] [--discover]<\/code><\/pre><\/div><h3 class=\"wp-block-heading\">Options<\/h3><p><strong>&lt;url&gt;<\/strong>\n: URL to retrieve oEmbed data for.<\/p><p><strong>[&#8211;width=&lt;width&gt;]<\/strong>\n: Width of the embed in pixels. Part of cache key so must match. Defaults to <code>content_width<\/code> if set else 500px.<\/p><p><strong>[&#8211;height=&lt;height&gt;]<\/strong>\n: Height of the embed in pixels. Part of cache key so must match. Defaults to 1.5 * default width, to a maximum of 1000px.<\/p><p><strong>[&#8211;discover]<\/strong>\n: Whether to search with the discover attribute set or not.<\/p><h3 class=\"wp-block-heading\">Examples<\/h3><div class=\"code-block-wrapper\"><div class=\"code-block-header\"><span class=\"code-block-language\">bash<\/span><button class=\"code-copy-btn\" aria-label=\"Copy code\"><svg><use href=\"https:\/\/chubes.net\/wp-content\/themes\/chubes\/assets\/icons\/chubes.svg#icon-copy\"><\/use><\/svg><\/button><\/div><pre data-chubes-enhanced class=\"wp-block-code language-bash\"><code class=\"language-bash\"># Find cache post ID for a given URL.\n$ wp embed cache find https:\/\/www.youtube.com\/watch?v=dQw4w9WgXcQ --width=500\n123<\/code><\/pre><\/div><h2 class=\"wp-block-heading\">wp embed cache trigger<\/h2><p>Triggers the caching of all oEmbed results for a given post.<\/p><p>oEmbed caches for a post are stored in the post&#8217;s metadata.<\/p><h3 class=\"wp-block-heading\">Synopsis<\/h3><div class=\"code-block-wrapper\"><div class=\"code-block-header\"><span class=\"code-block-language\">bash<\/span><button class=\"code-copy-btn\" aria-label=\"Copy code\"><svg><use href=\"https:\/\/chubes.net\/wp-content\/themes\/chubes\/assets\/icons\/chubes.svg#icon-copy\"><\/use><\/svg><\/button><\/div><pre data-chubes-enhanced class=\"wp-block-code language-bash\"><code class=\"language-bash\">wp embed cache trigger &lt;post_id&gt;<\/code><\/pre><\/div><h3 class=\"wp-block-heading\">Options<\/h3><p><strong>&lt;post_id&gt;<\/strong>\n: ID of the post to do the caching for.<\/p><h3 class=\"wp-block-heading\">Examples<\/h3><div class=\"code-block-wrapper\"><div class=\"code-block-header\"><span class=\"code-block-language\">bash<\/span><button class=\"code-copy-btn\" aria-label=\"Copy code\"><svg><use href=\"https:\/\/chubes.net\/wp-content\/themes\/chubes\/assets\/icons\/chubes.svg#icon-copy\"><\/use><\/svg><\/button><\/div><pre data-chubes-enhanced class=\"wp-block-code language-bash\"><code class=\"language-bash\"># Triggers cache for a post\n$ wp embed cache trigger 456\nSuccess: Caching triggered!<\/code><\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>Finds, triggers, and deletes oEmbed caches. Subcommands Command Description wp embed cache clear Deletes all oEmbed caches for a given post. wp embed cache find Finds an oEmbed cache post&#8230;<\/p>\n","protected":false},"featured_media":0,"template":"","meta":{"footnotes":""},"tags":[],"project":[690],"project_type":[749],"class_list":["post-5933","documentation","type-documentation","status-publish","hentry","project-embed","project_type-wordpress-reference"],"project_info":{"id":591,"name":"WP-CLI","slug":"wp-cli"},"project_type_info":{"id":749,"name":"WordPress Reference","slug":"wordpress-reference"},"_links":{"self":[{"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/documentation\/5933","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/documentation"}],"about":[{"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/types\/documentation"}],"version-history":[{"count":3,"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/documentation\/5933\/revisions"}],"predecessor-version":[{"id":9394,"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/documentation\/5933\/revisions\/9394"}],"wp:attachment":[{"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/media?parent=5933"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/tags?post=5933"},{"taxonomy":"project","embeddable":true,"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/project?post=5933"},{"taxonomy":"project_type","embeddable":true,"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/project_type?post=5933"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}