How to add YouTube videos to WordPress or blooger pages
Most often when we write a blog post we want to add our favourite youtube videos to it. If you don’t know basic HTML then you might find it a bit hard to figure out how Videos are embeded on web pages. In this post I will show you how to easily add any YouTube videos to wordpress or blogger post.
There are two easy ways to embed youtube videos on your blog post
1) HTML iframe
2) WordPress custom syntax.
Embed YouTube video on wordpress and blogger using Iframe
Iframe is an html tag to show page contents from home or external sites. You can use Iframe code to embed/show youtube video on your wordpress or blogger page. Don’t worry if you don’t know HTML. You just need to remeber the Iframe syntex and the same code can be modified to be used to add multiple videos. The following is the very basic Iframe code example to embed youtube videos on wordpress or blogger:
Here is the Iframe demo :
To embed your video , copy the id of video from youtube url and replace AJtDXIazr with your video id. Every video on YouTube contains an unique ID ,click on share icon on YouTube app and copy the ID string that is after “youtu.be/” and replace the above demo id with your unique ID. You can also adjust the height and width of your video in iframe using “width and height attributes.
YouTube video syntax for wordpress
If you are using wordpress, then you can simply use WP custom code to add videos to your wordpress posts . The following is the basic example:
This is the basic example of embedding youtube video on a wordpress site. Replace videoID with ID of the video you want to show on a wordpress post.