TL;DR: You can embed videos in WordPress using the Custom HTML block by pasting iframe embed code supplied by a video provider. This method provides greater control over certain player settings and is useful when a standard Embed block doesn’t meet your requirements. Your WordPress account must have the necessary permissions to save the HTML code.
TABLE OF CONTENTS
Overview
Using WordPress Hosting, you can add externally hosted videos to WordPress pages and posts using the Custom HTML block.
The Custom HTML block allows you to insert provider-supplied iframe code directly into your website content.
This method is useful when a video platform provides specific embed code or when you must adjust supported player settings that are not available through the standard WordPress Embed block.
Unlike uploading videos directly to WordPress, iframe embedding displays content hosted on an external platform without storing the original video file on your hosting account.
This guide explains how to embed videos using Custom HTML, understand iframe code and resolve common embedding issues.
What Is the WordPress Custom HTML Block?
The WordPress Custom HTML block allows you to insert HTML markup directly into a page or post using the Block Editor.
For video embedding, the block is commonly used to insert iframe code supplied by an external video platform.
An iframe is an HTML element that displays content from another website within your WordPress page.
Using iframe code can provide additional control over supported player settings, such as dimensions, playback behaviour and available controls.
However, the exact options depend on the video provider, and WordPress may restrict certain HTML elements based on your user permissions.
How to Embed a Video Using Custom HTML in WordPress
Follow these steps to embed a video using provider-supplied iframe code.
1. Login to the Domains.co.za Customer Portal.
2. Open the Manage Services dropdown menu.

3. Select Web Hosting or WordPress Hosting.

4. Click Manage next to the relevant domain.

5. Click Login next to Control Panel to access cPanel.
6. Open WP Toolkit, where available, and access your WordPress Dashboard for the relevant installation.

7. Select Posts or Pages from the WordPress Dashboard.
8. Open the page or post where you wish to embed the video.
9. Open the external video platform in another browser tab.
10. Locate the video’s sharing options.
11. Select Share and then Embed, where these options are available.
12. Copy the iframe embed code supplied by the video provider.
13. Return to WordPress and click the Block Inserter (+).
14. Search for Custom HTML and select the block.
15. Paste the iframe code into the Custom HTML block.
16. Use the block’s Preview option to check how the video displays.
17. Review the video dimensions and supported playback settings.
18. Preview the page to check its appearance on desktop and mobile devices.
19. Click Publish or Update to save your changes.
The video should now appear on your WordPress website, provided the external platform allows embedding and your WordPress account has the necessary permissions.
What Does iframe Video Embed Code Look Like?
An iframe is an HTML element that allows a webpage to display content hosted on another website.
A basic iframe structure may look like this:
<iframe
src="https://www.example.com/embed/video-id"
title="Description of the video"
width="560"
height="315"
allowfullscreen>
</iframe>
The main elements include:
- src: Specifies the URL of the externally hosted content.
- title: Provides a description of the embedded content for accessibility.
- width: Defines the intended width of the video player.
- height: Defines the intended height of the video player.
- allowfullscreen: Allows the video to enter fullscreen mode where supported.
Use the actual embed code supplied by your video provider rather than substituting a generic iframe URL.
How to Make iframe Videos Responsive in WordPress
Iframe code may include fixed dimensions that don’t automatically adjust to smaller screens.
To improve responsiveness, use the layout options supported by your WordPress theme or apply suitable responsive styling.
- Avoid setting iframe dimensions that extend beyond the available content width.
- Use responsive containers or suitable CSS where necessary.
- Check that the video maintains its intended aspect ratio.
- Preview the page on desktop, tablet and mobile devices.
- Ensure that playback controls remain accessible on smaller screens.
- Test custom styling after making changes to your theme or page layout.
If you are unfamiliar with CSS or HTML, consider using the native WordPress Embed block instead.
What Permissions Are Required to Use Custom HTML in WordPress?
WordPress allows users to add a Custom HTML block, but certain HTML elements may be removed when content is saved.
The ability to save unrestricted HTML depends on the unfiltered_html capability.
On standard single-site WordPress installations, Administrators and Editors generally have this capability. On WordPress Multisite installations, unrestricted HTML is typically limited to Super Administrators.
Security plugins, hosting policies and other configuration settings may introduce additional restrictions.
If iframe code disappears after saving, check your account permissions or contact the website administrator.
Why Is My iframe Video Not Working in WordPress?
An iframe video may fail to display because of incorrect embed code, restricted permissions, external platform settings or website security restrictions.
The iframe Code Disappears After Saving
WordPress may remove iframe elements if your account does not have permission to save unrestricted HTML.
The Video Displays a Blank Area
Check whether the external platform permits iframe embedding and whether the embed URL is correct.
The Video Does Not Display on Mobile
Review the iframe dimensions and any custom CSS that may prevent the player from resizing correctly.
The Video Provider Blocks Embedding
Some platforms restrict embedding to specific domains or require the video owner to enable external playback.
The Video Is Blocked by Website Security Settings
A Content Security Policy, security plugin or browser restriction may prevent the iframe from loading.
External iframe players may load additional scripts and resources. Consider reducing unnecessary embeds or using suitable loading optimisation methods.
Additional Information
- The WordPress Custom HTML block allows you to insert provider-supplied iframe code directly into pages and posts.
- iFrame embedding displays externally hosted videos without requiring the original video files to be stored on your WordPress hosting account.
- The unfiltered_html capability determines whether WordPress users can save certain HTML elements without filtering.
- WordPress may remove iframe code when the user doesn’t have the required permissions or security restrictions apply.
- Custom iframe code should only be copied from trusted video providers to reduce security and privacy risks.
- Fixed iframe dimensions may cause display issues on mobile devices unless responsive styling is applied.
- The iframe title attribute should provide a meaningful description of the embedded video for accessibility.
- External platforms may restrict iframe embedding through domain restrictions or other security settings.
- Website security policies and plugins may prevent iframe content from loading correctly.
- Third-party iframe content may process visitor information, so website owners should review applicable POPIA requirements.
- Adding several iframe players to one page can increase loading times because each player may load additional scripts and resources.
- Custom HTML and CSS changes should be tested carefully, and website owners should back up their websites before making significant theme or code modifications.
FAQS
What Is an iframe in WordPress?
An iframe is an HTML element that allows you to display content from another website within a WordPress page or post.
Can I Embed a Video Using Custom HTML Without a Plugin?
Yes. WordPress includes a built-in Custom HTML block that allows users with the necessary permissions to insert supported iframe embed code without installing additional plugins.
Why Does WordPress Remove My iframe Code?
WordPress may remove iframe code when your user account does not have permission to save unrestricted HTML or when security settings restrict the code.
Can I Change the Size of an iframe Video?
Yes. You can adjust supported width and height attributes or use responsive CSS to control how the video player appears within your page layout.
Is It Safe to Embed Videos Using iframe Code?
iFrame embedding is commonly used for external video content, but you should only insert code from trusted providers. Untrusted embed code may introduce privacy or security risks.
Do iframe Videos Use WordPress Hosting Storage?
The original video remains hosted on the external platform, so it doesn’t consume your WordPress account’s video file storage. However, the embedded player still loads external resources.



