Google Map with multiple locations in WordPress (iframe)
How to build a map with several markers in Google My Maps and embed it in WordPress as a full-width iframe, using WPBakery as the example.
WordPress
We show how to create a map with several location markers in Google My Maps and embed it on a WordPress page as a full-width iframe. The solution needs no API key and no programming.
Embedding a map with an iframe works on any website, not only in WordPress. The example uses the WPBakery plugin, but you can paste the finished code into any editor that accepts custom HTML.
Requirements
- a Google account (to create the map in Google My Maps),
- a WordPress site with the WPBakery plugin (optional, any block with custom HTML works too).
The screenshots show the Polish admin interface of WordPress and Google My Maps; the title attribute in the code stays as shown and should be translated into your page language.
Preparing the page structure
We start with a container for the map. The map should fill the whole screen width, so we add a Row element with the Stretch row and content (no paddings) option enabled.

Next, we add the built-in Google Maps widget to the container.

The widget contains a field with an iframe showing a sample location and one marker. We replace it with our own map with several markers.
In the Map embed iframe field, we set width="100%" so that the map fills the container. We set height as needed. In this example the map is 600 px high.
<iframe
src="https://www.google.com/maps/d/u/0/embed?mid=1QTmn9yOG2tXlLBUP74v3efnE6Sansk5D"
width="100%"
height="600"
style="border:0"
loading="lazy"
title="Mapa lokalizacji"
allowfullscreen>
</iframe>
The frameborder attribute is obsolete, so we remove the border with the border:0 style. The loading="lazy" attribute defers loading the map until the visitor scrolls near it. The title attribute describes the frame for screen readers.
Creating a map with multiple markers in Google My Maps
First, we sign in to a Google account and open https://www.google.com/maps/about/mymaps/.
- We click the “Try” button (Polish UI: “Wypróbuj”) and create a new map.
- We enter the location where we want to add a marker. In our example it is Poznań.
- We click the marker icon and add the marker to the map.


We add further markers with the same option. When the map is ready, we open the map menu, choose “Embed on my site” (Polish UI: “Umieść na mojej stronie”) and copy the generated code.

We paste the iframe generated by Google in place of the previous one. The code from Google has its own src with our map ID, and we replace its default dimensions with the ones from the previous step.
On the page, we get this view:

In Google My Maps we can refine the map further. We can draw a route between locations, change marker names and descriptions, pick a different base map and change pin colors.
Common problems
- The map does not show for visitors: in the map’s sharing settings in Google My Maps, allow access for anyone with the link.
- Changes to the map do not appear on the page: the map data is fetched live, but the browser or a cache plugin may serve an older version of the page for a while.
- The map is too short or too narrow on phones: check the
heightvalue and, if needed, set it in CSS separately for small screens.
Summary
Embedding a map with an iframe is a simple task, but the standard share option in Google Maps shows only one place. Google My Maps offers more: several markers, routes, descriptions and custom colors. We paste the finished code into a WPBakery widget or any other HTML block.
You can find more WordPress tutorials in our list of articles: insights.