Knowledge base / Billing & quota

Fix TOSViolationMapError on Google Maps

Google decided your website appears to violate the Google Maps Platform Terms of Service and disabled the Maps JavaScript API for it. There's no setting that switches this off. Make sure the page uses proper credentials, fix whatever breaks the terms, and appeal.

How to tell this is your problem

  • The console shows TOSViolationMapError.
  • Key restrictions, billing and enabled APIs all look correct in Cloud Console.
  • The site loads Maps in an unusual way: no key, a key borrowed from another site, or a script copied from somewhere else.

This is what the console shows:

Google Maps JavaScript API error: TOSViolationMapError
https://developers.google.com/maps/documentation/javascript/error-messages#tos-violation-map-error

Why it happens

Google's error reference says the website appears to violate the Google Maps API Terms of Service and the API has been disabled for it. To resolve the error it says to use API key or client ID credentials, and to appeal if you believe the block is wrong. Client IDs are now retired, so in practice that means an API key.

That points to two kinds of cause. Check both:

  • The page isn't using its own credentials. No key at all, a key taken from someone else's site, a shared key from a plugin vendor or a theme demo, or an old loader copied from a tutorial. Every site should load Maps with a key from a Cloud project its owner controls, with billing attached.
  • The page breaks the terms in how it uses the map. Google's appeal form names attribution as the most common compliance issue: the Google logo and copyright notices must be shown and must not be modified, obscured or deleted. The terms also restrict scraping and caching Google Maps content, and using it with a non-Google map.

This error is closely related to RefererDeniedMapError, which Google returns when an application is blocked after several email notices. If you see that code, use the RefererDeniedMapError guide. The appeal process is the same.

The fix, step by step

  1. 01Check what the loader sends. View source and find the Maps script. Confirm it has key= with a key from your own project. If it has no key, a key you don't recognise, or client=, fix that first.
  2. 02Create your own restricted key if needed. In your Cloud project, with billing linked, create a key under APIs & Services → Credentials. Restrict it to your website and to the Maps APIs the page uses. See adding a missing key.
  3. 03Check attribution on every map. At desktop and mobile sizes, the Google logo and copyright text must be visible. Remove CSS that hides them, and move cookie banners, sticky bars and overlays away from the bottom edge of the map.
  4. 04Check how the site uses Maps data. Look for scripts that save geocoding or Places results into your own database beyond what the terms allow, or that put Google content onto another provider's map. Stop or rewrite them.
  5. 05Search for Google emails. Project owners and billing contacts may have been told what Google found. Use that wording in your appeal.
  6. 06Appeal. Submit Google's Maps API abuse appeal form at support.google.com/cloud/contact/maps_tos_appeal. Include the affected URLs, the error message, your Google Maps Platform project number and a clear list of what you changed.
  7. 07Wait for the email reply. Google says responses arrive by email within a few business days.
HTML
<!-- Wrong: no key of your own, copied from an old tutorial -->
<script src="https://maps.googleapis.com/maps/api/js?callback=initMap"></script>

<!-- Right: your own restricted key -->
<script async
  src="https://maps.googleapis.com/maps/api/js?key=AIzaSy...your-key&loading=async&callback=initMap"></script>

WordPress, themes and plugins

Some themes and older map plugins ship with a demo key or a vendor's shared key so the map works out of the box. That key isn't yours, and you can't fix its restrictions or billing. Put your own key in every place a key can be set. Our guide to page builder key fields lists where to look.

Also check for “clean map” styling that hides the Google branding, and for more than one Maps loader on the page. A second loader with someone else's key can trigger this even when yours is correct. See duplicate loaders.

What not to do

  • Don't borrow another key to get the map back. That is the kind of use that leads to this error.
  • Don't hide the attribution to make an overlay fit. Resize the overlay instead.
  • Don't send the appeal before the fix is live. Google reviews the site as it is.

Confirm it is fixed

Once Google replies, load the page in a private window with the console open. The map should render with the Google logo and copyright visible, and no Maps errors in the console.

Run a scan from a clean session. It lists every Maps loader on the page and the credential each one sends, which catches a plugin still loading Maps with a key that isn't yours.

Common questions

What triggers TOSViolationMapError?

Google decided the website appears to violate the Maps Platform terms. Common issues are loading Maps without your own credentials and hiding or covering Google's attribution.

Can I fix TOSViolationMapError without contacting Google?

Fixing the cause comes first, but Google disabled the API for the site, so expect to file the appeal form and wait for Google's email reply.

Is TOSViolationMapError the same as RefererDeniedMapError?

They're closely related. Both are terms enforcement and both are appealed through the same form. RefererDeniedMapError specifically follows several email notices.

Does the error mean my Google account is banned?

The error says the API was disabled for the website. Check Cloud Console and your email for any notice about the project or account as well.

Check whether this is your error

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

Related articles