You want to improve the quality of your blog and make your posts more lively using video? If so, this post is exactly what you are looking for. This post will show you How to embed a YouTube Video, a great method to make your site alive, in your posts and pages, as well as in your widget areas and in comments you leave.
Using the video’s URL
While watching the video, please copy the URL of your video which is in your web browser’s address bar.
After copying the link, please paste it in the Visual editor and all the rest of the process will be taken care of by WordPress. Please kindly note that you need to make sure that the URL is not hyperlinked and shortened.
Using a shortcode
Using shortcode will enable you to customize the video’s size and settings. Firstly, you need to copy the URL of the video.
After that, you can use the format below for the shortcode, but you need to change the URL of the format with the URL of the video you want. Please remember to preview or publish your post first in order to see how the video will be displayed as you cannot see the preview in the editor. Here this the format of the shortcode:
[youtube https://www.youtube.com/watch?v=WVbQ-oro7FQ]
Inserting a playlist
WordPress allows its users to embed a playlist from YouTube instead of only a single video. In order to do that, you just need to copy the URL of the playlist the the address bar while you are watching that playlist.
Please remember to copy the full URL that has &list=… at the end, which means you need to copy the full link of the playlist instead of the video that is currently playing. Next, you can either paste the link in the Visual editor or just simply create a shortcode using the following format. Do not forget to replace with your URL and make sure that the shortcode need to be on a line by itself. Here is the format of the code.
[youtube https://www.youtube.com/watch?v=_mDxcDjg9P4&list=PL-edf9crl0NaavjRedvfFFhMvOTvFpDVI]
Please also remember that you are able to preview it before you publish the post.
Some options to customize video
Only by adding &w=...
or &w=...&h=...
to the shortcode, you are free to set the specify the width and height when the video is displayed in your post. Moreover, Appending &rel=0
will allow it to show only videos from the same channel instead of showing all the related videos.
Here is an example of customizing the video to make it wider than the default embed without custom width and height settings:
[youtube https://www.youtube.com/watch?v=_Oh12ROTQCE&w=640&h=385]
Below are the examples that WordPress currently support:
-
Embedding videos with default width and height adapted to your current theme:
[youtube https://www.youtube.com/watch?v=_Oh12ROTQCE]
-
Specifying the width and height explicitly:
[youtube https://www.youtube.com/watch?v=_Oh12ROTQCE&w=320&h=240]
-
Specifying the width only:
[youtube https://www.youtube.com/watch?v=_Oh12ROTQCE&w=320]
-
Left aligning the player:
[youtube https://www.youtube.com/watch?v=_Oh12ROTQCE&align=left]
-
Right aligning the player:
[youtube https://www.youtube.com/watch?v=_Oh12ROTQCE&align=right]
-
Hiding the related videos after the video is done:
[youtube https://www.youtube.com/watch?v=_Oh12ROTQCE&rel=0]
-
Starting at a certain point in the video: Firstly you need to convert the time of the point you want from minutes and seconds to all seconds, and then add that number as shown
[youtube https://www.youtube.com/watch?v=_Oh12ROTQCE&start=75]
-
Specifying a start and end time for a video: You also need to cover the point to all seconds and add the start and the end time.
[youtube https://www.youtube.com/watch?v=WVbQ-oro7FQ&start=75&end=500]
-
Hiding the information bar:
[youtube https://www.youtube.com/watch?v=_Oh12ROTQCE&showinfo=0]
Inserting in the Sidebar/Footer
Embedding YouTube videos in your sidebar or footer is a piece of cake if you use WordPress. Only by copying and pasteing the URL and using this following format into a Text Widget. Here is the format you need to follow:
[youtube https://www.youtube.com/watch?v=_Oh12ROTQCE]
Embedding video in the comment
Wanting to leave comments with a YouTube video? Just grab the URL of the video you want and put it in the comment field.
Please wait for your comment to be posted or approved, after that, you can view the video directly in the comment section.
Troubleshooting
If you experience any troubleshooting problem, you can check out the Troubleshooting Embed Links doc from WordPress.
Conclusion
All in all, we hope that this intructional writing will help you to embed YouTube video into your posts and pages. Since there are several ways to embed YouTube videos, we hope that you will be able to find the most suitable way for your site.