YouTube Video Embedding Not Working In Gutenberg
If your YouTube video is not embedding properly on your WordPress site, try the steps in the video above to fix the issue. This is a sneaky and harmful bug because the YouTube video will appear fine in your Gutenberg Page Editor. Only after you publish the post, and view it on your site, you might realize that the YouTube video is not embedded in the post. Instead, you get a YouTube URL that is not a link or anything. It is just plain text of the YouTube URL. Since it is doubtful that your visitors will highlight a URL and paste it into the address bar, we need a fix ASAP!
Fix 1 – Use The Whole YouTube URL
The first thing you can try is to use the entire URL of the YouTube video. That didn’t work on this site, but it worked for several people when you research this bug. Below is the solution that worked for this site.
Fix 2 – Convert Reusable Blocks to Regular Groups
If you are using reusable blocks within Gutenberg, and the YouTube video is within a reusable block, that might be causing the problem. Remove that reusable block, or convert it to a regular group (performed in the video above). This bug was reproduced in the video to confirm that this was causing the YouTube video to not display correctly.
Summarizing Reusable Blocks
A few bugs in reusable blocks have been discovered the past few days. Here is another reusable block bug. On the one hand, they have huge potential to save people time and work. On the other hand, if reusable blocks are going to introduce issues, we might need to rethink how to use them. In this case, it is easy to remove the reusable block status once you put it into your site. As a best practice, if you can decouple the reusable block from the post, and convert it to a regular group or list of regular blocks, you will avoid some of the bugs that reusable blocks introduce.