Fixing Disappearing CMS Map Embeds
When a custom multi-location map shows up in your page editor preview and vanishes on the live site, the cause is usually HTML sanitization, a collapsed container height or a script restriction inside the CMS block.
Across website support forums, one of the most frustrating moments for a marketer or designer happens right after clicking Publish. You build a custom map with thirty store locations or event pins, copy the embed snippet, paste it into your page editor, and see the map render inside the preview window. Then you open the live URL in a new tab and find a blank white gap where the map should be.
In a widely read thread on the WordPress.org support forums, a site owner reported that their public Google My Maps embed previewed normally inside the block editor, failed to appear on the published page, and vanished from the block when the editor was reopened. On the Squarespace and Wix Studio forums, designers report similar roadblocks when trying to embed multi-pin maps: custom JavaScript embeds return NULL, script tags are disabled in preview, or HTML widgets fail to resize on mobile screens.
Why CMS editors strip or hide map code
When an embedded map disappears between the editor and the live page, one of four mechanisms is almost always responsible:
- HTML sanitization on save: Content management systems such as WordPress filter raw HTML when a post is saved. If a user account does not have the
unfiltered_htmlcapability, as happens for non-admin roles or on multisite installations, WordPress strips<iframe>tags out of standard blocks on save even if the browser rendered them moments earlier in the client-side preview. - Pasting HTML into an oEmbed URL block: Many page builders have two separate blocks: an Embed block that expects a plain URL from a known oEmbed provider, and a Custom HTML or Code block that accepts raw
<iframe>markup. Pasting HTML into a URL-only block or a URL into a raw script block causes the embed to fail silently. - Inline JavaScript versus iframe sandboxing: When teams try to build a multi-marker map using the Google Maps JavaScript API directly, the snippet relies on
<script>tags and external callback functions. Platforms like Squarespace disable custom scripts while logged into the editor or block them on entry-level billing tiers, whereas standard HTTPS<iframe>embeds run inside their own isolated document context. - Zero-height parent containers: In CSS Grid and Flexbox layouts common in Wix Studio and Webflow, an iframe set to
height: 100%inside a parent div that has no explicit height collapses to zero pixels high on the live page.
Use the right embed mode for your CMS block
In Tasmap's Preview & Share workspace, the Embed panel gives you both an Embed URL and a complete HTML snippet so you do not have to hand-edit tags to fit your website builder:
- If your CMS uses an iframe URL widget or an embed element that asks only for a web address, copy the Embed URL directly.
- If you are placing a Custom HTML block in WordPress or a Code block in Squarespace or Webflow, copy the HTML snippet.
To prevent the zero-height container bug, pick the sizing option that matches your page layout before copying the code:
- Responsive ratio applies an explicit width-to-height proportion such as
16:9,4:3,1:1or a custom ratio from 1 to 100. Because the ratio is built into the snippet, the map calculates its own height from the column width and never collapses to zero pixels. - Fill container is built for layouts where you have already given the parent wrapper a fixed pixel or viewport height in your design tool.
Check saved state and public access in an incognito window
When testing a map embed, remember that your own browser session is logged into your map editor. In Tasmap, anyone can view a published map without logging in, and the editor preview shows your live unsaved changes while the public link, QR code and embedded map always serve the last saved version.
Before you close the tab, click Save in the Tasmap editor, publish your CMS page, and open the live website in a private browser window on a phone to verify that both the initial viewport and the content scale between 25% and 100% look clean to a first-time visitor.
References
- embedding a custom google map will preview but not publish, WordPress.org Support. User report and troubleshooting of custom map iframe code previewing in the editor and disappearing upon publication.
- Custom googlemap with multiple pins and custom pin image, Squarespace Forum. Issues with script disabling and null embeds when adding custom multi-pin maps to Squarespace pages.
- Google Maps embed in Wix Studio, Wix Studio Forum. Community discussion on embedding multi-location and service-area maps in Wix Studio.
Related reading
Create a multi-location map with ready-to-paste embed URLs and responsive HTML snippets at tasmap.app.