How to Easily Embed iFrame Code in WordPress

Why Should I Embed iFrame Code in WordPress?

An iFrame lets you embed videos or other content on your site without actually having to host that video. This can save you bandwidth and storage space, which is why you should never upload a video directly to WordPress.

The iFrame will update automatically if the original content changes. This means visitors will always see the latest version of the content.

Embedding copyrighted content via an iFrame also doesn’t violate copyright, so it can help protect you against lawsuits.

Having said that, let’s see how you can easily embed iFrame code in WordPress. 

Method 1: Use the Source’s Embed Code to Add iFrame in WordPress (Quick and Easy)

Many large video hosting sites (like Thinglink or YouTube) have an ‘Embed’ option that gives you access to the iFrame code you need to add to your site.

If the website has any ‘Sharing’ or ‘Embed’ settings, then this is often the quickest and easiest way to embed content.

The exact steps will vary depending on the platform, but let’s look at Thinglink as an example. To embed Thinglink media in WordPress, simply click on the ‘Share’ button in the top right corner on the media you want to use.

After that, you’ll see a popup with different sharing options.

Simply go ahead and click on the ‘Embed’ button.

Thinglink will now show you the iFrame code.

After that, go ahead and click the ‘Copy’ button.

Now, you can paste that code into any post or page on your site. In this guide, we’ll add it to a new page in the WordPress block editor.

Simply open the page and then click on the ‘+’ button. In the popup that appears, start typing ‘HTML’ to find the custom HTML block.

When the right block appears, click to add it to your page.

Then, simply paste the iFrame code into the block.

You can now publish your page to see the Thinglink media live on your WordPress site.

Method 2: Manually Creating the iFrame Code and Embedding in WordPress (No Plugin Required)

If you don’t want to use a special WordPress plugin, then you can create the iFrame code manually. To do this, you need to open the page or post and then add an HTML block in the WordPress content editor.

Easily embedding iframe code in WordPress

First, paste the following code into your HTML block:

1 <iframesrc="URL goes here"></iframe>

Simply replace ‘URL goes here’ with the direct URL for the content that you want to embed.

Here, we are embedding a Google Map:

Entering the iFrame code for the Google map

You can add extra parameters to change how the content looks on your website. For example, we are setting the width to 600 pixels and the height to 200 pixels:

1 <iframesrc="URL goes here"width="600"height="300"></iframe>

This is useful if you need to show the embedded content in a smaller space.

The Google map on the site with a set height and width