Google Map Shortcode Version 1.1

The new version of Google Map Shortcode is ready, some bugs were fixed and new features included.

The first release was based on “address”, then to include a point on the maps new instance of google geocoder was need, but google limits the number of this kind of request, read more here.

In this version new custom field “google-map-sc-latlng” was included to save the (Latitude,Longitude) for each address entered:

Now, you can include points on your maps using one of this custom fields considering this:

  • If you use “google-map-sc-address”, the first time that you display a point, the “google-map-sc-latlng” value will be generated automatically.
  • In order to use “google-map-sc-latlng” you need to include the latitude and longitude separated by comma.
  • If you update “google-map-sc-address” you must delete the “google-map-sc-latlng” cause this point will be located based on the previews address.
  • You can use “google-map-sc-latlng” only.
  • If you are planning to display large number of point is better to use “google-map-sc-latlng” or generate them one by one to avoid large number of address requests at the same time. You can generate latitude and longitude using for instance:
  • You can attache more than one point per post/page but based on address or (latitude,longitude) see the example bellow.
  • If you are displaying all the points under specific category, just the first costum field of each post will be used.

The shortcode options can be found in the first release.


This example shows the points attached to the posts under the category 42 cat=”42″ and display the links to the points at the bottom of the map, external_links=”true”.

In this example the map displays some points on South Florida:

and the custom fields looks like this:

Using the post “id” id = “335”.

Using specific address option in the sortcode (not the custom field) address=”3501 S.W. 130th Ave., Davie 33330″,width=”250″, height=”250″ and zoom=”8″.


The Info Window is showed when you are displaying post on your maps for example the posts under a category or when you use the post ID, just in these cases make sense to display the the title, thumbnail and excerpt of your posts.

You can change the html and the css of the Info Windows to cutomize it.

The shortcode name is google-map-sc



Add your suggestions, support the plugin.

91 thoughts on “Google Map Shortcode Version 1.1”

  1. This is exactly what I’m looking for, but can’t get it to work. I’ve put in a postcode in a custom field, but it shows up on the map as in Switzerland, even though when you put it in Google Maps it shows the place I want to show. Where am I going wrong?

  2. Hi Alain:

    Cool plug-in, thanks!

    I’m trying to figure out if it’ll work for a page I’m building.

    I have an existing Google Map on the page (using the API, etc) that uses custom tiles and has zooming/panning disabled.

    I want to be able to make posts in WordPress, and use your plug-in to have them show up on my existing map — not generate a new one. Is that possible?

  3. Thank you for this plug-in. It is exactly what we needed. I have two questions:
    First, is it possible amend the code to make the satellite or terrain version come up first when the page is loaded. Secondly, i would like the map itself to be centered, rather than focused on the last post.
    Please let me know if there is any reference that i could use to make these changes. thank you!

  4. Hey great plugin! I’m wondering if it’s possible to automatically pull the address from custom fields? I have many posts that are just listings which have the address, city, state in different custom fields. Is there a way to pull the address from these without manually doing it for each post?

  5. That should have read, in sidebar.php I’m doing:

    echo do_shortcode (‘[google-map-sc address="86 broadwater street west, worthing, uk" width="380" height="300" zoom="15"]‘)

  6. @Dave
    Dave, I can appreciate using the custom field google-map-sc-latlng when adding it to a page, but I want to include it in my template. At the moment I’m doing this in my sidebar.php:

    How could I do long / lat instead of using address= ?

  7. maps are not being displayed onto the page

    where the map should be there is the following in the html

    div style=”display: none” UA:D [1.8.1_1037] closing div

  8. @Alex Stanhope


    I’ve sorted out hiding the “balloon”/clicking through to posts point I raised in my previous message – just needed some judicious use of location.href and commenting out the call to openInfoWindowHtml; pretty simple to do in all honesty!

    However, I’m still a bit flummoxed as to why one of the several maps on my page isn’t centering properly – any thoughts?

    I’ll look forward to your response!


  9. Hi Alain,

    Firstly, thanks for taking the time to code up this great plug-in, which I have just installed on a WP 2.9.1 site I’m currently building, and I can confirm that everything is working fine as regards compatibility between Google Map Shortcode 1.1 and WP 2.9.1 🙂

    I did have a couple of quick questions though – is it possible to disable the InfoWindowHTML “balloon” that appears when markers are clicked, and just have it so that the markers click through to the posts that they are associated with?

    Also, I’ve got a couple of maps set up on the site, but on one of them, the Map window doesn’t seem to centre on the “cluster” of markers that are shown within it – in fact they, seem to go off the edge of the map. The development version of the site is password-protected, but I’ll gladly provide the relevant details if you wanted to take a look at all?

    Thanks again for all your great work!

Leave a Reply

Your email address will not be published. Required fields are marked *