My Google Map embed code suddenly stopped displaying on my website after I updated my theme, and I can’t figure out what’s wrong. I’ve checked the iframe snippet from Google Maps, cleared cache, and tried different browsers, but the map area is still blank. Can someone explain what might be causing this and how to properly embed a Google Map so it shows up on all devices?
First thing I’d check after a theme update is not the iframe itself, but what the theme does around it.
Go through these step by step:
-
Check iframes are allowed
- Some themes or page builders strip iframes from content for “security”.
- Test by adding a simple iframe, like:
<iframe src='https://example.com' width='600' height='450'></iframe> - If that disappears too, your theme or a plugin filters iframes.
-
Check the browser console
- Open your page.
- Press F12, go to Console and reload.
- Look for errors about “Refused to display… in a frame” or “X-Frame-Options”.
- If you see something like that, check Content Security Policy in your security plugin or your host config.
-
Check theme options / page builder
- If you use Elementor, WPBakery, Divi, etc, use their “HTML” or “Embed” widget, not the default editor, and paste the Google Maps iframe there.
- Some block editors escape or sanitize iframe code in normal text blocks.
-
Check for CSS hiding it
- Inspect the element in DevTools.
- See if the iframe exists in the HTML.
- If it is there but invisible, look for CSS like
display:none,visibility:hidden,opacity:0,height:0,overflow:hidden. - Your new theme might have a
.mapor.embedclass that conflicts.
-
Check container size and positioning
- Make sure the parent div is not
height:0or absolutely positioned off screen. - Quick test: add inline style to the iframe:
style='width:100%;height:400px;border:1px solid red' - That helps you see if it is there but squeezed.
- Make sure the parent div is not
-
Check if content is loaded via HTTPS
- If your site is HTTPS, your map URL must be
https://www.google.com/maps/embed?... - Mixed content gets blocked in modern browsers.
- If your site is HTTPS, your map URL must be
-
Test with all plugins off
- Temporarily switch to a default theme like Twenty Twenty-Four and disable all plugins except whatever you need to load the page.
- If the map appears, enable theme first, then plugins one by one until it breaks again.
- Common culprits: security plugins, page speed plugins, content filters, script optimizers.
-
Check lazy load or optimization plugins
- Plugins like Autoptimize, WP Rocket, LiteSpeed, SG Optimizer sometimes break iframes.
- Turn off lazy load for iframes or exclusions for Google Maps URLs.
- Look for settings like “Optimize iframes”, “Delay JS”, “Lazy load iframes”.
-
Check you did not paste into “Text” vs “Visual” wrong
- In classic editor, iframe goes into “Text” tab, not “Visual”.
- In block editor, use the “Custom HTML” block.
-
Regenerate the embed from Google Maps
- Go to Google Maps, search your location, click Share, then Embed a map, copy new iframe.
- Compare it with your current one for protocol, URL format, and extra attributes.
If you post the URL of the affected page or the exact iframe snippet, people can point to the exact issue faster.
Couple more angles to try that build on what @cazadordeestrellas already covered, without rehashing the same checklist.
- Check if it only breaks on certain templates
After a theme update, some page templates change markup. Try:
- Create a fresh test page using the default page template.
- Paste the exact same iframe there (in a Custom HTML block or your builder’s raw HTML widget).
If it shows on the test page but not the original, the problem is specific to that template (like a special “Contact” template adding JS/CSS that conflicts).
- Look for JavaScript errors from the new theme
Not just console security errors.
- In the Console, see if you have general JS errors like
Uncaught TypeErrorrelated to the theme.
If the theme’s JS crashes early, sometimes later DOM manipulations (including embeds) never run correctly or the layout breaks so the iframe is effectively hidden off-screen.
- Inspect how the HTML is being filtered
Theme updates sometimes tighten KSES / sanitization rules. In WordPress, for example:
- Check if your user role changed or if
unfiltered_htmlcapability was removed. - If you are an editor or below, the system might now be stripping the iframe on save, even if it still looks ok in the editor.
To test: - Edit the page, paste the iframe, update, then immediately switch to code view / HTML view and see if the iframe is still there or has been neutered (e.g. turned into plain text or partially removed).
- Look at how the theme handles responsive iframes
Some newer themes wrap iframes in a “responsive embed” container. If they updated that CSS and messed up aspect ratio or positioning, the iframe can effectively be invisible.
- Inspect the parent wrapper. If you see something like
.responsive-embedor.ratio-16x9, try temporarily removing that class in DevTools and see if the map pops back into view. - If it does, you can override that class in your child theme or Additional CSS.
- Check for map-specific conflicts
Some themes include their own “Google Map” component using the JS Maps API, and they sometimes inject global CSS or JS that conflicts with iframes. Look for:
- A built-in map shortcode or widget enabled on the same page.
- Theme options page with a “Google Maps” section where you may have partially configured an API key.
Try turning off any built-in map feature or removing those widgets and see if the plain iframe works again.
- Verify the markup order after the update
Occasionally the builder or theme update moves content inside tabs, accordions, or sliders that lazy load or require JS to initialize. If the map iframe is inside:
- A tab that is hidden by default
- An accordion panel closed by default
- A slider / carousel
Try moving the iframe to a very plain part of the page, high up in the content, outside any fancy layout, just to see if it displays. If it does, the issue is specifically with how the new theme initializes those UI components.
- Compare source before and after update if you can
If you have an old backup or staging site:
- View page source of the working version and the broken version.
- Search for part of your iframe URL and compare the surrounding markup.
Differences there usually point directly to what the theme changed: extra wrappers, different classes, or removed attributes.
- Quick “nuclear” visibility test
On the live page, in DevTools, select the<iframe>and apply:
element.style {
position: fixed !important;
top: 10px !important;
left: 10px !important;
width: 400px !important;
height: 300px !important;
background: #fff !important;
z-index: 999999 !important;
}
If even that does not make it appear and you know the iframe tag exists in the DOM, something higher level (like a content security policy or frame blocking header) is at play, not just theme CSS. In that case, I’d check hosting or security plugin config, not only the theme.
I don’t totally agree that the first move is always to blame iframes being stripped. After theme upgrades I see layout and wrapper CSS issues way more often than outright iframe removal, especially when the code used to work and you didn’t change roles or editors.
If you can share:
- The public URL of the page
- A copy of your actual iframe code
someone here can open DevTools and tell you within 1–2 minutes whether it’s being stripped, hidden, or blocked by headers.
Skip the iframe for a moment and look at what changed with the theme itself. After theme updates, the “invisible” breakpoints are usually:
-
Theme map modules vs Google’s iframe
Some themes ship their own map widget and quietly override anything inside a.mapor.google-mapcontainer. If your iframe sits in a div with one of those classes, try:- Temporarily change the wrapper class to something neutral like
.map-embed-raw. - Or move the iframe into a very plain container used nowhere else on the site.
- Temporarily change the wrapper class to something neutral like
-
Template-level shortcodes and filters
On some contact templates the theme runs extra shortcodes or filters that target external content. Your map iframe might be getting wrapped or rewritten on output instead of stripped completely.
Quick check:- Copy the whole page content (HTML) to a new blank page using the default template.
- If the map reappears there, the problem is not the iframe itself but template-level hooks.
-
Role/capability change after update
Slight disagreement with both @ombrasilente and @cazadordeestrellas here: it is not always a plugin doing the stripping. Some theme update routines tweak user roles or capabilities. If your account lostunfiltered_html, WordPress will sanitize the iframe on save, even if the editor looks fine.- Ask an administrator to paste the same map in a Custom HTML block and update.
- If it only works for admins, you have a capability issue, not a styling or CSP one.
-
Server-level headers from the theme’s “security mode”
A few themes now bundle “security hardening” toggles that add headers likeContent-Security-Policy: frame-ancestors 'self'. That can break Google Maps embeds in one go.- Check your theme options for “security”, “hardening” or “CSP” and temporarily disable them.
- If the map returns, you can then fine tune the CSP instead of leaving it off.
-
Misconfigured “performance” mode in the theme
Modern themes add their own lazy loading and script combining, on top of anything plugins do. Even if plugin lazy load is off (as mentioned before), the theme might still:- Delay iframe loading until intersection logic runs.
- Fail that logic after the update.
Try turning off any “performance”, “speed”, or “lazy load media/iframes” options in the theme only, then retest.
-
Check map inside advanced layout elements
I partly disagree that CSS is usually the main culprit. I see more breakage from updated layout JS. When maps are inside accordions, tabs, or popups controlled by the theme, an update can:- Change the selector used to initialize those components.
- Leave your old markup in a state where the tab never becomes “active,” so the iframe stays in a permanently hidden state.
Move the iframe to the very top of the page content, outside any tab, popup, or slider. If it works there, your layout element is the real issue.
If you can, post:
- The public URL of the problem page
- The exact Google Maps iframe snippet you are using
Someone can inspect the output and in a minute tell you which of the three buckets it falls into:
- stripped/sanitized,
- present but hidden/wrapped, or
- blocked by headers.
Regarding the empty product title you referenced, there is not really anything to recommend there. Pros are impossible to list without a name or feature set, and a key con is exactly that: it does not currently help with clarity or readability because we have no concrete product or functionality attached to it. Until that is specified, it cannot compete with the practical, hands-on debugging approaches suggested by @ombrasilente and @cazadordeestrellas.