Home » WordPress » How to add Google maps to WordPress

How to add Google maps to WordPress

If you want to add a map to WordPress website, you’re probably looking for plugin which would let you do it without too much work. There are various ways to embed Google maps to WordPress page, and here you’ll find three common and very practical ones:

How to embed Google maps to WordPress Gutenberg editor

There’s no need for third party plugins if you want to add a Google map with a single marker to WordPress. Here’s how you do it:

  1. Go to Google Maps website and look for an address you want to show on the map.
  2. Click Share icon, and select Embed a map tab.
  3. Click COPY HTML to copy the Google Maps code you’ll need to enter to WordPress.
how to embed google maps to wordpress page

Now open any WordPress post or page you want to embed Google map to. Add Custom HTML block where you’ll want the map to show up.

wordpress how to add google maps code

Paste previously copied Google map code to the Custom HTML block. It should look more or less like that:

how to embed google maps to wordpress using block editor

That’s it – Google map now will show up in your WordPress website.

Couple of tips which might be useful:

  • you can change Google Map height by editing height attribute. Example shows height=”450″ (450 pixels height) but you can add any number you like there. The same way you change Google Map width.
  • if you need Full width Google Map in WordPress page or post, move this Custom HTML block to GROUP element in WordPress editor. Don’t forget to set Group width as Full width, and change width in an embedded map to some large number (for example width=”3840″). No worries about a large number – Google Maps iframe is responsive so it will adapt to browser window.

How to add Google map with multiple markers to WordPress

Sometimes you may need to add multiple markers to a single map. For example if you want to add store locator in WordPress website. The previous method I wrote won’t work in this situation because Google does not let adding multiple markers to a Google Map embed. But there’s an easy way to accomplish it in WordPress anyway.

Go to Plugins >> Add New, and search for WP Google Maps plugin.

wordpress google maps plugin

Once you install and activate plugin go to Maps in WordPress admin menu, and create a new map.

Once you start creating a map you’ll be asked which map engine you’d like to use. You can select free OpenLayers engine, or Google Maps engine. Both work fine, but Google Maps engine requires to create an API.

Here’s the example with OpenLayers engine. Adding and editing markers in a map is quite simple.

wordpress google maps plugin

Once you finish building a map with multiple markers scroll to top of the page, and copy map shortcode.

how to add google maps shortcode to wordpress

After saving changes you’re map will be added to your website.

How to add Google map to WordPress without compromising website speed

Adding Google Maps to WordPress post or page means adding additional external code library to the system. In some cases it might add one or couple of seconds to the website’s loading speed.

It’s not an issue if you’re adding Google map only on the company’s contact page but it will have a big impact for SEO if you use Google maps on homepage or on every single page of your website.

Best WordPress hosting 2024

There’s a simple solution for that. Instead of embedding Google maps directly to website you can add a picture of the map (PrintScreen the map), and put a link on a map which would go to Google Maps page. This way there won’t be no website speed penalty, and your website visitor still have fully functioning and zoomable map if they need it.

Tags:

Fathom analytics - privacy focused cookie-free website analytics

Most popular tutorials


Get our latest WordPress news and special offers from RockSolidWP!

Only useful WordPress and WooCommerce tips and tricks and exclusive offers for our readers once a month. No marketing nonsense.

Looking for reliable yet affordable WordPress hosting?
Hostinger is the way to go!

Get 10% OFF by using code IMAKEITWORK