Resources

What is an iframe?

HTMLHTML5SEOLoading speediframe HTML tagembedded objectsembedded codeuses of the iframe elementiframesiframewhat is iframe?
Updated October 29, 2020 Christine Afandi

An iframe, also known as an inline frame, is an HTML element used to embed objects on a webpage by importing them from an external source and integrating them in another web page’s HTML document. In other words, an iframe is an extra frame – or a window, if you like – on a web page where we link to and display external sources.

 

iframe

 

Examples of the resources used in an iframe are videos, maps, graphics, adverts, or e-commerce products, to mention but a few. The most important elements to include here is the <iframe></iframe> tags that enclose the code. Then make sure you have the SRC which refers to the source of the third-party object embedded in your HTML document on your site. And last but not least, the dimensions of the frame in height and width.

 

Do iframes contribute to the SEO of a web page?

While these embedded objects are a nice way to spice up your web page, they are still considered external objects, i.e. belonging to another website or page. So, search engines will not take them into consideration when ranking your page as they do with your own media. Therefore, they do not help SEO in a direct way but they can help with readability and user retention.

 

However, if overused, iframes can be more harmful than beneficial as they also contribute to a slower loading time, which can create a bad user experience and implicitly affect your ranking.

 

Can iframes impact browser and loading performance?

So, if you want to add iframes into your HTML document, you should be careful not to overdo it. The more you embed objects of any kind onto your web pages, the more the website becomes bloated. In turn, a bloated website will slow your page loading speed, and the bandwidth of your website will start to decrease.

 

Remember that each iframe is like a window/page, the more you have embedded with code, the more the pages. Each page requires a request separately to the server, and at the same time, each page needs a window for the browser to manage. So, if you have many of them inside your content not only will loading speed decrease but also the performance of the browser will sink.

 

The most common use for iframes

As mentioned in the beginning, despite their faults, iframes are still quite a popular way to embed media into our webpages and make them more lively. And the most common reasons we do that are sharing content, more specifically videos. Let’s say you are writing a blog post or an article and you have no time to make your own video. But you did find an interesting one from one of your sources that would be perfect.

 

How to Copy embed code on youtube

 

So, instead of creating the video from scratch, you decide to embed the video on your website by placing an iframe tag in the HTML of your document. And just like that, the video appears within your content, naturally, simply, and seamlessly. And the best part is that most video players, including Youtube, already give a “copy embed code” option for you to copy the source code, and just paste it inside your HTML code.

Conclusion

In the end, iframes are a quick way to add a video to your content. They are also useful for external widgets, such as social media buttons like the Facebook Like button, or the Tweet Button, chats, and sometimes even maps. However, as stated before, these are external resources so if the owner changes anything on these elements, they might break and not show on your platform. They also open up your website for vulnerabilities, especially with less trusted sources. So, at the end of the day, it is highly recommended to not use them unless absolutely necessary.

 






Leave a Reply

Your email address will not be published. Required fields are marked *