Embed a Countdown Timer in WordPress
Free iframe embed — no plugin install, no PHP edits. Works with the Block Editor (Gutenberg), Classic Editor, Elementor, Beaver Builder, and Divi. Takes about two minutes.
<iframe src="https://gotimer.org/e/countdown?duration=86400&label=Launch+in&theme=auto&accent=%23E8613C" width="100%" height="420" frameborder="0" allow="autoplay" loading="lazy" style="border-radius:12px;border:0;max-width:480px;"></iframe>
This is exactly what your visitors will see. Copy the markup and paste it into a Custom HTML block.
Block Editor (Gutenberg)
- Open the page or post in the WordPress admin and click the + button to add a new block.
- Type HTML and select Custom HTML. (It's under the Formatting category.)
- Paste the iframe markup from above into the block.
- Click Preview in the block toolbar to see the timer render. Save the draft.
- Publish.
Classic Editor
- Open the page or post.
- Click the Text tab (top-right of the editor area). This switches from the visual editor to the raw-HTML editor.
- Paste the iframe markup at the cursor position. Do not wrap it in
<p>tags — the editor will add paragraph wrappers automatically that don't break the embed. - Click Update to publish. Switch back to the Visual tab to confirm the embed appears (it will display as a small box with a placeholder).
Elementor
- Edit the page in Elementor.
- Drag the HTML widget from the left panel onto the page.
- Paste the iframe markup into the HTML Code field.
- Hit Update in the bottom-left. The embed renders live in the Elementor preview.
- For sticky / floating placement, wrap the HTML widget in a section with Position: Fixed enabled.
Beaver Builder
- Open the page in Beaver Builder.
- Add an HTML module from the Basic Modules tray.
- Paste the iframe markup into the HTML field.
- Save the row. Beaver Builder renders the embed live in the front-end preview.
Divi
- Open the page in the Divi Builder.
- Click + to add a module and choose Code.
- Paste the iframe markup into the Content field.
- Save changes and exit the builder.
Troubleshooting common WordPress embed issues
The iframe shows up blank
Almost always a caching plugin (WP Rocket, W3 Total Cache, LiteSpeed, Cloudflare APO) interfering. Two things to check:
- Clear the cache after pasting the embed for the first time.
- Verify your security plugin isn't adding an aggressive CSP header that blocks
frame-src. The embed needsframe-src https://gotimer.orgallowed (most defaults already permit it).
The Block Editor strips the iframe
You used a paragraph or heading block instead of Custom HTML. The Block Editor sanitises HTML inside text blocks. Use the dedicated Custom HTML block.
The Classic Editor wraps the iframe in <p> tags
Harmless — the embed still renders. If your theme's CSS adds margin to <p> elements, you may want to wrap the iframe in a <div class="no-margin"> instead.
Mobile renders the embed too wide
Set width="100%"on the iframe (already done in our generator) and the embed will scale to the parent container's width. If your theme has a fixed-width content column, also set max-widthon the iframe's style.
Dynamic per-post countdowns with ACF
For automated workflows — say, every product post has a launch date and you want the countdown to drive itself from a custom field — add a small snippet to your theme's functions.php:
function gotimer_countdown_from_acf($atts) {
$launch_date = get_field('launch_date');
if (!$launch_date) return '';
$seconds = max(0, strtotime($launch_date) - time());
$url = 'https://gotimer.org/e/countdown?duration=' . esc_attr($seconds);
return '<iframe src="' . $url . '" width="100%" height="320" frameborder="0" loading="lazy"></iframe>';
}
add_shortcode('gotimer_countdown', 'gotimer_countdown_from_acf');Then drop [gotimer_countdown]into any post template and the countdown derives itself from the post's launch_date custom field.
Once you have it on one page
Try the configurator on /embed for a different timer type — Pomodoro for a study blog, chess clock for a board-game review site, round timer for a fitness blog. Same iframe mechanic, every type supported.
Related
Embed a Countdown Timer in WordPress FAQ
Do I need to install a WordPress plugin for the countdown to work?
Will it work on WordPress.com (the hosted version)?
Will the countdown survive the Cloudflare or WP Rocket cache?
Does the embed slow down my Lighthouse / PageSpeed score?
loading="lazy" on the iframe (the markup we generate already includes it) so the embed only loads when the visitor scrolls to it — that keeps your Largest Contentful Paint and Total Blocking Time scores unaffected.Can I add the same countdown to multiple pages?
duration anchor.What about ACF, custom fields, or shortcodes?
duration from a custom field via a small PHP snippet in functions.php or a shortcode plugin. Pseudocode: $seconds = get_field('launch_seconds'); echo '<iframe src="https://gotimer.org/e/countdown?duration=' . esc_attr($seconds) . '"></iframe>';