
If you’ve ever wanted to show a video, map, form, or even another webpage inside your WordPress site without uploading it yourself, iFrames can help. An iFrame is a simple piece of HTML code that lets you display content from another site on your page. It works like a little window that shows whatever is on the other side, from YouTube videos to Google Maps.
Using iFrames in WordPress is useful when you wish to share something that’s hosted elsewhere. Instead of downloading and uploading content or copying code that may break your layout, you can embed it. This saves space on your server and keeps your WordPress website running faster.
Additionally, iFrames also help you avoid legal trouble. When you embed a video or a tool, you’re not claiming it as your own, you’re merely sharing it from its source. That keeps things fair and gives credit where it’s due.
This guide explains everything step by step: You learn what WordPress iFrames are, different ways to add them (with or without a plugin), and how to ensure they look good and work well on all devices. We’ll also cover some best practices for using iFrames.
KEY TAKEAWAYS
- WordPress iFrames let you display content from another website on your page or post.
- You can embed videos, maps, forms, or even full web pages using simple iFrame code.
- Adding iFrames manually is easy with the HTML block or Classic Editor’s Codeview.
- Plugins like Advanced iFrame or iFramemake it easier to add and customize iFrames.
- Always ensure your iFrames are mobile-friendly and load fast using lazy loading.
- Only embed content from trusted and secure (HTTPS) sources to avoid security risks.
- Check your embedded content regularly to ensure it is working correctly and looks good.
- Use official embed codes when platforms like YouTube or Facebook provide them.
- If an iFrame doesn’t load, the source site may be blocking it. Try another link.
- Following best practices helps keep your site clean, fast, and safe while using iFrames.
TABLE OF CONTENTS
What Are WordPress iFrames & Why Use Them?
An iFrame, or inline frame, is a small piece of code that lets you show content from another website right inside your WordPress page. Instead of linking to another page and sending visitors away, you can keep them on your site and still show that content.
There are many reasons to use WordPress iFrames. One of the most common is to embed YouTube videos. Instead of uploading the video file to your WordPress website, you add the iFrame code, and the video appears on your page. The same goes for PDFs, Google Maps, online forms, calendars, or even full web pages from another domain.
Using WordPress iFrames also has some advantages. First, you’re not copying the content; you’re simply displaying it, which helps you avoid copyright problems. Second, since you’re not hosting the content yourself, your site stays lighter and faster. Large video or media files won’t slow things down. And finally, if the source content changes, your site also updates automatically. You don’t have to go in and change anything. It stays fresh on its own.
Overall, iFrames make it easy to share useful content, keep your WordPress site fast, and stay within legal limits, all while Improve User Experience – Part 1: Enhance Your WordPress Website.
Add a WordPress iFrame Using the iFrame HTML Tag
In this section, we show you 3 ways to add iframe to WordPress:
- Using the iFrame HTML Tag
- Using Embed Code
- Using a WordPress Plugin.
Let’s start with the first method.
This method is straightforward. However, the steps vary based on which WordPress editor you use. In this section, we discuss how to embed iFrame in WordPress using:
- Exploring the Features of Gutenberg WordPress Editor
- Classic Editor
Gutenberg Block Editor
Open the post or page where you want to embed the content. Click + to add a new WordPress block. Search for Custom HTML and click it.

Paste your iFrame code into the box. For example:
<iframe src="https://example.com" width="600" height="270" allowfullscreen></iframe>
Next, click Preview to check how it displays. If it looks good to you, click Publish (or Save for existing pages).

Classic Editor
If you’re using Classic Editor, you can also embed iFrames there. Here’s how:
Go to the post or page where you want to add the WordPress iFrame. Switch from Visual to the Code tab. Then, paste your iFrame code where you want it to appear. Lastly, click Update or Publish to save your changes.

Regardless of what editor you’re using, you can make your WordPress iFrame look and behave the way you want by changing its attributes:
For width and height, set the width and height (in pixels) of the iFrame on your page.
<iframe src="https://example.com" width="600" height="400"></iframe>
The title is a short description of the iFrame content. This helps screen readers and improves accessibility.
<iframe src="https://example.com" title="Example Site"></iframe>
Also, allowfullscreen allows the embedded content to be displayed in full screen if supported (like videos).
<iframe src="https://example.com/video" allowfullscreen></iframe>
The frameborder adds or removes the border around the iFrame. Use 0 for no border.
<iframe src="https://example.com" frameborder="0"></iframe>
You can mix and match these settings based on what you’re embedding and how you want it to appear. For more attributes and corresponding details, refer to the MDN web documentation.
IMPORTANT:
Some websites block embedding. If you try to embed a page and it doesn’t appear, the site may have disabled it. Additionally, mixing Understanding The Key Difference Between HTTP And HTTPS can cause problems. If your WordPress site uses HTTPS (which it should), ensure the content you’re embedding also uses HTTPS. Otherwise, browsers may block it.
As you can see, adding iFrames manually is a quick way to display external content. Just ensure you test how it looks on your site and that it also works on mobile.
Use the Official Embed Code
Many platforms provide their specific copy-paste embed code. These are usually iFrame tags that are pre-set with the correct URL, size, and features. They’re tested to work well with their platform, so you don’t have to tweak anything.
You may use this method if:
- You’re embedding content from big platforms (YouTube, Facebook, Instagram, etc.).
- You wish the content to display exactly as the platform designed it.
- You want the embed to include extra features, like autoplay, buttons, or sharing options.
- You don’t want to write or change the iFrame code manually.
These official WordPress iFrame codes are optimized for performance, mobile use, and legal display. They also auto-update if the original content changes.
Now, let’s look at how to embed a Facebook or Instagram post on your WordPress website.
Experience high-performance WordPress Hosting with advanced tools like LiteSpeed caching, cPanel access, automated updates, and malware protection—all designed to simplify your workflow.
Backed by real human support and smart features, our platform is designed to grow with your goals.
Embed Facebook/Instagram Post
Go to the Facebook post you wish to share. Click the three dots (⋯) and select Embed.

Now, click Copy Code to copy the given code.

Then, paste it into a Custom HTML block in WordPress.

Similarly, you can copy the embed code of an Instagram post by navigating to ⋯ → Embed and use it within a WordPress post or page.

TIP: Always preview your page after embedding content to ensure it loads and displays correctly. Some 10 Top Free WordPress Themes for your Website may block scripts or WordPress iFrames in areas, so test on different devices if possible.
Use Plugins to Embed WordPress iFrames
If you’re not comfortable adding HTML manually or want more control over how your iFrames work, using a plugin is a smart choice. WordPress plugins make it easier to embed iFrames and often give you extra features that you can’t get with plain code.
Plugins take the guesswork out of embedding. Instead of writing HTML, you fill in a few settings or use a shortcode. Many plugins also give you options to control the size, style, and even the visibility of your iFrame. This can save time and help you avoid mistakes.
Here are two popular plugins that make adding iFrames to WordPress simple:
- Advanced iFrame: This plugin gives you full control over your WordPress iFrame. You can resize it, hide certain parts of the page you’re embedding, and even load content only when necessary (which helps with website speed).
- iFrame: This plugin is a lightweight option that focuses on shortcodes. It’s great if you want a quick and simple way to add iFrames.
Whatever plugin you choose to use, ensure you How To Update WordPress Plugins In cPanel.
For this section example, we use the iFrame plugin. To use it, you first need to install and activate it on your WordPress website. Once your plugin is active, you can add WordPress iFrames using a simple shortcode and following the steps below:.
Open the post or page where you want to embed the iFrame. Add a Shortcode block (in the Gutenberg Editor) or paste the shortcode directly in the Classic Editor’s Code section.
You may use this basic format:
[iframe src="https://example.com" width="600" height="400"]
Ensure that you replace the example URL with the one that you wish to embed.
Once you’re satisfied with how it looks, click Save to save your changes.

TIP: You may refer to the tutorial, WordPress Blocks Features and Site Customization Options, to learn more about blocks.
Best Practices for Using iFrames in WordPress
When using iFrames on your WordPress site, it’s important to follow some best practices to ensure everything looks good, works smoothly, and keeps your visitors safe.
First, always ensure the iFrame is responsive. That means it should adjust to different screen sizes, especially on mobile phones and tablets. A fixed width may look fine on a desktop, but it can disrupt the layout on smaller screens. To fix this, you can How to Add WordPress Custom CSS: 5 Easy Methods or choose plugins that automatically make your iFrames mobile-friendly.
Next, Analyzing WordPress Site Speed and Performance Metrics. Loading an iFrame too early can slow down your page. To speed up, Boost Your Website: Why You Need WordPress Lazy Load. This delays the loading of the iFrame until a visitor scrolls down to it. Just add loading=”lazy” to your iFrame code or use a plugin that supports this feature. This helps reduce the web page load time and improves user experience.
Security is also a key part of using iFrames. Never embed content from websites you don’t trust. Some sites contain harmful scripts that can affect your site or users. Stick with well-known sources, especially when embedding tools, videos, or forms.
Finally, ensure you check your embedded content regularly. Sometimes, the content you’re showing may be removed, moved, or changed by the original site. If that happens, your iFrame may show an error or a blank space. A quick review now and then helps you clear your pages and make them look professional.
Following these tips keeps your site secure, fast, and user-friendly, while still letting you share helpful content from other places.
![Fast, secure, and reliable WordPress Hosting from Hosted.com Strip Banner Text - Fast, secure, and reliable WordPress Hosting from Hosted.com. [More Info]](https://www.hosted.com/articles/wp-content/uploads/2025/06/wordpress-iframe-2-1024x229.webp)
FAQS
Can I use iFrames to embed content from any website?
Not always. Some websites block their content from being loaded in an iFrame for security reasons. If an iFrame doesn’t show up, the site you’re trying to embed is likely preventing it. In that case, you may need to link to the content instead.
Are iFrames bad for SEO?
WordPress iFrames don’t directly help with SEO because search engines can’t read the content inside them. However, they don’t hurt your SEO either; just ensure you provide a title or description around the iFrame so search engines can understand what the page is about.
How can I fix an iFrame that shows a blank area or error?
This usually happens when the source site blocks embedding. Try checking if the site supports iFrames by visiting their content embed guide. Also, ensure the URL uses HTTPS if your site does, to avoid mixed content issues.
Can I use WordPress iFrames to embed PDF files or Google Docs?
Yes. You can use an iFrame to display a PDF or a Google Doc by copying the shareable embed link and pasting it inside an iFrame tag. Just ensure the file is publicly accessible or it won’t display properly.
How does embedding with oEmbed differ from using iFrames?
oEmbed is a WordPress feature that automatically turns a URL into embedded content (like a YouTube video) without needing code. WordPress iFrames require you to paste an HTML tag. oEmbed is easier but offers less control compared to custom iFrames.
Other Related Tutorials
– How To Embed A PDF In WordPress: Manual & Plugin Setup
– How To Remove Author From WordPress Posts: 5 Easy Ways
– WordPress Salts & Security Keys What They Are and How to Use
– How to Create a WordPress Image Carousel X Easy Ways
– WordPress Breadcrumbs: How To Add & Display Them On Your Site