Knowledge base / Embeds

Replace a broken Google Maps iframe embed

If all you need is a pin on an address, the Embed API is simpler and harder to break than a JavaScript map.

How to tell this is your problem

  • The iframe renders an error page instead of a map.
  • An old share URL stopped working.
  • You need a map but have no interest in managing a key.

Why it happens

Share URLs copied from the Maps website are not stable embed endpoints. The Embed API is the supported path and needs only a basic key.

The fix, step by step

  1. 01Generate an Embed API URL of the form maps/embed/v1/place with your address.
  2. 02Set a key restricted to the Maps Embed API and your domain.
  3. 03Replace the old iframe src, keeping width, height and loading=lazy.
  4. 04Give the iframe a title attribute for accessibility.

Confirm it is fixed

The frame loads a map with no console errors; scan the page to confirm nothing else is still calling the JavaScript API.

Check whether this is your error

A scan tells you in about twelve seconds, from a clean session.

Related articles