Armstrong Websites

Articles · Website basics

How to add a Google Map to your website

By Armstrong Websites. Published . Updated .

To add a Google Map to your website, find your business on Google Maps, click Share, choose the Embed a map tab, and copy the code. Paste that code into an HTML or custom code block on your contact page. Then set the width to 100% so the map fits a phone screen.

The whole job takes about ten minutes. This guide covers each step, the settings worth changing, and the cases where a map is a bad idea.

Check that your business shows on Google Maps first

The embed code pulls from the listing Google already has. Search your business name in Google Maps on a computer. If your listing appears with the right address, you are ready.

If it does not appear, fix that first. Why your business does not show up on Google Maps lists the common causes. If you have no listing yet, how to set up a Google Business Profile, step by step walks through it.

Get the embed code

Use a computer for this. The embed option is not offered in the phone app.

  1. Open Google Maps in a web browser.
  2. Type your business name or street address in the search box.
  3. Click your listing in the results.
  4. Click Share.
  5. Click the Embed a map tab.
  6. Pick a size from the drop-down menu if you like. You will change it later.
  7. Click Copy HTML.

The code starts with the word iframe. It is one long line of text. Do not edit the web address inside it.

Paste the code into your page

Where you paste depends on how your site is built.

Website builders. Most builders offer an embed, code, or HTML block. Add one to your contact page and paste the code inside. Many builders also offer a built-in map block. That block asks for an address and does the same job with no code. Use it if you prefer.

WordPress. Add a Custom HTML block to the page and paste the code there. Some page builders for WordPress have their own embed block that works the same way.

A site built by a designer. Send the code to your designer, or ask them to add the map. This is a small request.

Preview the page after you save. You should see a map with a pin on your location.

Change the size so it fits phones

Google’s code includes a fixed width, such as 600. A fixed width can spill off the edge of a small screen. Change the width to 100%.

Here is how the settings should read:

  • Width: 100%
  • Height: 400 (a good height for most pages)
  • Border: none, which the code already sets as border:0

Keep the loading="lazy" part of the code. It tells the browser to load the map only when a visitor scrolls near it. That keeps the top of your page fast. Why is my website slow and how to fix it covers other causes of slow pages.

After you save, open the page on a phone and check it. How to test your website on a phone shows what to look for. Make sure a visitor can scroll past the map. A tall map can trap a thumb, so keep the height modest.

Add a title for screen readers

The code includes a title setting, or you can add one. This is a short label that screen readers announce. Write what the map shows. For example: title="Map showing our shop on Smith Street". Use your own street name.

A clear label helps visitors who use screen readers. What is website accessibility and how to start covers more steps like this one.

Put the map where people look for it

The best spot is your contact page, under your address and hours. Visitors who want directions go there first. Put the address as plain text above the map. Do not rely on the map alone. Search engines read text, and people can copy it into a navigation app.

A footer map on every page adds weight and rarely helps. One map on the contact page is enough. If you have a storefront, a map on the homepage can also work.

Add a link that opens your location in the Google Maps app. On the Share tab, choose Send a link, copy it, and use it for a button labeled “Get directions.” Phone visitors tap that button and the app opens with turn-by-turn directions.

When to skip the map

You work from home. A map pinned to your house shows your address to everyone. If customers do not visit you, leave the map off. Show your town or service area in text instead.

You travel to customers. A contractor, cleaner, or mobile groomer has no place for customers to find. A map of one address can mislead. Name the towns you serve instead. How to write a service area page for a local business explains how.

You only meet by appointment elsewhere. If clients meet you at a rented room or a partner’s space, say so in words and give that address.

If you want a map of an area and not a pin, search for the town name in Google Maps, then use the same Share and Embed steps. The map will center on the town with no business pin.

Know what the map does and does not do

An embedded map helps visitors find you. It does not replace your Google Business Profile, and it does not move you up in search results by itself. Your profile, your reviews, and matching details across the web matter more. Why your business name, address, and phone must match everywhere explains why.

An embedded map also loads content from Google. If your site has a privacy policy, mention third-party tools like this one. Does a small business website in Canada need a privacy policy? covers what to include.

Fix a map that does not show

If the page shows a blank box, check these causes:

  • The code was cut off. Copy it again and paste the full line.
  • The block strips code. Some blocks turn code into plain text. Use an HTML or embed block, not a text block.
  • An ad blocker or privacy setting hides it. Test in a different browser.
  • The pin is wrong. Go back to Google Maps, confirm the listing address, and copy a new code.

If you get stuck, send a note through the contact page with a link to the page and a description of what you see.

Ready when you are

Book a coffee