Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

What is: iFrame

Editorial Note: We earn a commission from partner links on WPBeginner. Commissions do not affect our editors' opinions or evaluations. Learn more about Editorial Process.

An iFrame is an inline frame used inside a webpage to load another HTML document inside it. This HTML document may also contain JavaScript and/or CSS which is loaded at the time when iframe tag is parsed by the user’s browser.

WordPress users often come across iframes when they are trying to embed something from an external source into their WordPress site. The most common example of an iframe embed code is the YouTube video embed code which looks like this:

<iframe width="420" height="315" src="//www.youtube.com/embed/qzOOy1tWBCg?rel=0" frameborder="0" allowfullscreen></iframe>

In the above example, the iframe tag loads YouTube’s video player with the video ID provided in the code. It has other parameters defined as well, such as height, width, frameborder, etc. These parameters will be used by the script which loads YouTube video player.

Many other third party websites may provide users with an iframe embed code to insert certain elements on their websites. Most commonly web analytics service providers, social media websites, and video sharing sites offer users embed code in iframe format.

Caution: Users are advised to be cautious when they are asked to embed iframe code into their website. You should only embed an iframe code into your website if it is from a reliable source, and you are certain about the identity of the website. Sometimes hackers may also leave iframe code in a WordPress site as a backdoor. This code loads itself in an iframe and provides hackers remote access to a hacked WordPress site.

Additional Reading

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

WPBeginner Assistant
How can I help you?

By chatting, you consent to this chat being stored according to our privacy policy and your email will be added to receive weekly WordPress tutorials from WPBeginner.