Tips and tricks
How to embed a DynTube video channel in WordPress or LearnDash
A channel embed is not a bigger video embed. It is a pair — a resizer script and a channel iframe — and it only exists once the channel has been saved. Paste it into a Custom HTML block, then confirm it survived the save and works for a learner.
Updated 30 August 2026
Before you start
- The channel exists and has been saved. Its embed code is built from the channel’s iframe link, which a channel does not have until it is saved — until then the Embed Code dialog says the iframe link is missing rather than showing a snippet.
- The channel contains the videos you want learners to see, and those videos have finished processing.
- Your WordPress account can save raw HTML — see the capability boundary further down. On a standard single site that means an Administrator; on a multisite network only a Super Admin holds it by default.
- You know which surface the channel belongs on: an ordinary WordPress page, or a LearnDash lesson or topic. The snippet is the same in both.
How a channel embed differs from a video embed
| Single video | Channel | |
|---|---|---|
| What it is | One self-contained iframe. | A DynTube resizer script followed by the channel iframe. |
| Identifier it carries | The video’s embed key. | The channel’s iframe link. A video embed key cannot be used here. |
| How it takes its size | A wrapper div reserves a fixed 16:9 box. | The iframe is declared width:100% and height:100%, so it takes its size from the element around it, together with the resizer script. |
| Extra script on the page | None. | Yes — the resizer script is part of the snippet and must be pasted with it. |
Step 1 — copy the channel embed code
- Open the channel in the DynTube dashboard and choose Embed Code.
- Choose Responsive to let the channel adapt to the container it is placed in, or Fixed Width to lock it to a set pixel width.
- For Fixed Width, pick Small, Medium, Large or Custom. Custom takes a width in pixels.
- Copy the generated Embed Code. The dashboard has already filled in the channel’s iframe link and player host.
The examples here show the same generated shape with the link written as YOUR_CHANNEL_IFRAME_LINK. Copy the dashboard’s version rather than typing one of these — your account may be served from a different player host.
<script src="https://embed.dyntube.com/iframe/v1/if-resizer.min.js"></script>
<iframe style="border:0;width:100%;height:100%;" src="https://dyn.tube/embed/channel/YOUR_CHANNEL_IFRAME_LINK" allow="autoplay; fullscreen" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>Responsive is the same snippet with nothing wrapped around it. Because the iframe is declared at 100% width and height, the space it occupies comes from the block, column or lesson content area it is pasted into — so on a narrow theme the channel is narrow, and there is no fixed aspect box to fight with.
<div style="margin:auto;width:640px;">
<script src="https://embed.dyntube.com/iframe/v1/if-resizer.min.js"></script>
<iframe style="border:0;width:100%;height:100%;" src="https://dyn.tube/embed/channel/YOUR_CHANNEL_IFRAME_LINK" allow="autoplay; fullscreen" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
</div>| Choice | Wrapper width |
|---|---|
| Small | 480px |
| Medium (default) | 640px |
| Large | 854px |
| Custom | The width in pixels that you enter |
Step 2 — paste it into WordPress or LearnDash
- In WordPress, open Pages and the page you want to edit — or, for a course, open LearnDash LMS and the lesson or topic.
- Place the cursor where the channel should sit, type “/” to open the block inserter, and choose Custom HTML.
- Paste the whole snippet, script tag included. Pasting only the iframe leaves the channel without its resizer.
- Use the block’s Preview toggle to confirm the channel renders in the editor.
- Publish or Update.
Why a Custom HTML block, and who can use one
A rich-text or paragraph field is sanitised on save, and both halves of this snippet are exactly what sanitisation removes — script tags first, then the iframe. A Custom HTML block is the field intended to hold raw markup.
Even there, WordPress only keeps raw HTML for users who hold the unfiltered_html capability. On a standard single site that is the Administrator role; on a multisite network it is narrowed to Super Admins. An Editor or Author can paste and save without seeing an error while WordPress silently drops the markup. A script tag is the more fragile half: some sites keep the iframe and remove the script, which leaves the channel rendered but unsized.
Checking it worked
- Reopen the saved page or lesson in the editor and confirm both the script tag and the iframe are still present.
- View it as a learner — a logged-in enrolled account, or a second browser profile — not as the administrator who pasted it.
- Open a video from the channel on that learner view and start playback. A channel that lists videos but will not play is a playback problem, not an embed problem.
- Check the page on a phone. Responsive should fill the column with no horizontal scrollbar; a fixed width will not reflow.
- If you later add, remove or reorder videos in the channel, reload the page and confirm the change is reflected — you do not need to re-paste the snippet for that.
If the channel does not appear
| What you see | Likely cause | What to do |
|---|---|---|
| The dialog will not give you a snippet | The channel has no iframe link yet, which is what the dialog’s “save the channel and try again” notice means. | Save the channel, reopen Embed Code and copy it again. |
| The snippet is gone after saving | The account that saved the page does not hold unfiltered_html, or a plugin sanitised the content. | Save from an account that holds the capability and check for content-filtering plugins. |
| The channel renders but is collapsed or the wrong height | The resizer script was stripped or blocked while the iframe survived. | Confirm the script tag is still in the saved markup and that nothing on the site blocks scripts from the DynTube embed host. |
| Nothing renders at all | A content-security policy is blocking frames or scripts from the DynTube hosts. | Allow the player host in frame-src and the embed host in script-src. |
| It works for you but not for learners | The page is being viewed from a host the project does not allow playback from. | Add every host learners actually use — including staging and preview domains — to the project’s allowed domains. |
| The embed overflows on mobile | A fixed width was chosen that is wider than the phone viewport. | Switch the embed to Responsive, or choose a smaller fixed width. |
Current WordPress and channel behavior
- LearnDash controls who reaches the lesson; the channel embed controls nothing about who may play its videos. Use the project’s playback rules for that.
- The channel iframe link is the identifier in this snippet. Anyone who copies the markup out of a page holds it, so restrict playback by domain if that matters.
- The private share URL, live subdomain URL and channel key offered alongside the embed code in the dialog are separate ways to reach a channel — they are not interchangeable with the embed snippet.
- Fixed width locks the wrapper, not the aspect ratio, so a fixed-width channel is not automatically 16:9.
Something missing or wrong here? Tell us and we will correct it. New to DynTube? Start with uploading and embedding.