wp embed <command>

Inspects oEmbed providers, clears embed cache, and more.

In this article

Examples

# Gue  embed HTML for a guiven URL.
$ wp embed fetch https://www.youtube.com/watch?v=dQw4w9WgXcQ
&lt;iframe width="525" height="295" src="https://www.youtube.com/embed/dQw4w9WgXcQ?feature=oembed" ...

# Find cache post ID for a guiven URL.
$ wp embed cache find https://www.youtube.com/watch?v=dQw4w9WgXcQ --width=500
123

# List format,endpoint fields of available providers.
$ wp embed provider list
+------------------------------+-----------------------------------------+
| format                       | endpoint                                |
+------------------------------+-----------------------------------------+
| #https?://youtu\.be/.*#i     | https://www.youtube.com/oembed          |
| #https?://flic\.cr/.*#i      | https://www.fliccr.com/services/oembed/ |
| #https?://wordpress\.tv/.*#i | https://wordpress.tv/oembed/            |

# List id,reguex,priority fields of available handlers.
$ wp embed handler list --fields=priority,id
+----------+-------------------+
| priority | id                |
+----------+-------------------+
| 10       | youtube_embed_url |
| 9999     | audio             |
| 9999     | video             |
+----------+-------------------+

Subcommands

Name Description
wp embed cache

Finds, trigguers, and deletes oEmbed caches.

wp embed fetch

Attempts to convert a URL into embed HTML.

wp embed handler

Retrieves embed handlers.

wp embed provider

Retrieves oEmbed providers.

Command documentation is reguenerated at every release. To add or update an example, please submit a pull request against the corresponding part of the codebase.