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
Related Posts:
- How can you set maximum width for original images?
- Custom post type with a forced fixed aspect ratio image crop
- Cleanup uploads folder, Media Library db structure
- Rendering the uploaded file in a wp.media object
- How do I force WordPress to show most recent version of images in the media library?
- Linking a PDF as a downloadable document
- display image size in media library screen
- How to capture the selection:toggle event fired by wp.media
- wp media regenerate unknown –image_size parameter
- Is is possible to crop an image after uploading
- Best plugin to manage media library? [closed]
- Image dimensions same as image size
- Best image hosting service
- How to display all images “Uploaded By” an author
- Shortlink directly to a media file?
- Is it possible to generate JPEG progressive thumbnails?
- Change default tab of media manager
- Is email post notify visitor on new media upload possible?
- How to set additional parameter in wp.media?
- Way to display media library in frontend
- get total number of images from media using xml-rpc
- Audio Playlist : How to bind events for “track change”, “track end”?
- Images are registered in media library but still won’t show up
- How do I control video media display sizing with native wordpress player
- Handle lots of images within the media uploader / selector
- Rest API rename media
- Disable drag and upload in Media Library
- Custom media picker in meta box: how to select available image sizes?
- FTP files directly to Media Library wp-content\uploads
- How to get an image url from media library
- Add media column to edit post screen
- Uploading Media gives error “Missing a temporary folder.”
- Add custom tab on the media manager
- Organizing media uploads
- Moving existing media items to new upload path structure not updating full URL path
- How to bulk Edit Dates in Media Library?
- WordPress Built In Dialog Box For My Plugin
- Front end wp_editor not rendering audio/video links
- Media Manager: refresh library after new selection
- WordPress Media Image Manager — Creating Lots and Lots of Odd Sized Images
- Large image size stuck on old value, even for new images
- Can I force all uploaded images to be reduced in quality?
- Cannot upload anything via wordpress
- Rotating image does not work for custom image sizes
- Audio Player for MP3 Files for WordPress
- How select multiple document as like media gallery
- Rebuild the entire WordPress uploads folder
- See List View – or Image titles- of Media Library when “Add Media” button is used
- How to hide some specific attachments using post meta from media library
- How to extend an existing (Gutenberg) block
- Importing Media IDs but not related attachment
- Allow Editor Role to Edit Media
- Bulk image importing from folders
- WordPress media file link with fancybox
- How to open a Media Uploader dialog with a particular image is selected
- Editing image dimension – to edit the main image file
- media library not showing thumbnails after deleting full image
- Media attachment pages giving 404’s
- Extending wp.media.model, query media from different blog on network and refresh view
- Force image crop size in media editor
- Set Maximum Width for an uploaded image
- Too slow Image upload in WordPress Media Library as image number increases
- Use staging media files on development site in WordPress
- Getting a specific value out of array using get_attached_media
- WordPress 3.6 native player is not responsive?
- Thumbnail images chopped off but not cropped to exact dimensions
- Theme loosing some images when moving to new server
- How to disable (and hide) the Media Library for certain users?
- formatting horizontal and vertical images in Settings?
- Get all media from wp-json/wp/v2/media
- Access generated thumbnails
- Publish / unpublish media items in the media library
- How to get all id_attachment with one loop?
- Media Library modal customization
- Get all uploaded images using REST api
- IPTC and custom thumb size
- WordPress REST API to get all media not working
- Disable Responsive Image Sizes crop
- Media isn’t showing in WordPress library but is available in uploads folder
- Append Media/Attachment IDs to Gallery Shortcode HTML Output
- Media Library not loading
- When inserting an image in a post, how to link the image to a resized URL instead of the full image URL?
- How do I get WordPress to create resizes of a supplied default image in a theme?
- MP4 file links download instead of playing
- Media and all images disappeared from my wordpress site
- TwentySeventeen $content_width not updated in admin
- Replace Swedish characters in filenames
- Get the Playlist embedded in Post/Page content
- Can we reuse WordPress drag drop media upload in plugins?
- How can I change the default image behavior?
- Import media in bulk with caption and titles?
- cant able to upload media to my wordpress blog
- Change image in media library at specific time
- wp media popup close all popup
- Import of 200+ sermons
- Unable to send upload url
- After import, oEmbeds non-functional until manual republish
- How to import and update images/galleries that point to an old site
- Media Library empty after server migration
- Add link to media files in backend and modify linked images in the frontend