Search code examples
google-mapsgoogle-search

Prevent encoded polylines for maps getting indexed by Google search?


I have a bunch of pre-built html pages (000's) that include google maps. I embed the encoded polyline for the map in a hidden div in the html because 1) I've already got it at build time and 2) I want to avoid a call back to the server to get it when the page is rendered. Google search is indexing the text of the encoded polyline, webmaster tools is showing keywords like "JpByANe" etc...

Any way to prevent Google from indexing this text that doesn't involve removing the polyline from the html? I really don't want to make another javascripty/ajax-type call to the server at run time.


Solution

  • Print Javascript into the page during template rendering from the backend and put it into a variable there. Then use that to initialize your map.