1

I get this error on multiple WordPress sites I run, when I try paste a YouTube video or use the shortcode [embed]:

YouTube failed to embed

This only happens with YouTube. Other media websites such as Vimeo has no problem with the embed.

1 Answer 1

1

This may be due to a failed network request from the server to youtube. If the server cannot reach YouTube, the embed will show as "failed to embed" in the editor.

You can fix the problem by allowing the server to make network requests to youtube.

The WordPress Proxy documentation may be helpful, https://developer.wordpress.org/reference/classes/wp_http_proxy/

WordPress core code -

https://github.com/WordPress/WordPress/blob/master/wp-includes/class-oembed.php#L362-L364 https://github.com/WordPress/WordPress/blob/master/wp-includes/class-oembed.php#L457-L480

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.