To be honest, Google Map is one of my favorite tools from Google. For any business site, this is a very great tool to show you visitor where your office is located. Turn out that adding a Google Map to your WordPress site is really easy and in this article, we’ll show you how.
Although WordPress already comes with auto-embed feature for Twitter, Youtube and other popular services, the auto-embed feature doesn’t support Google Map.
The Native Way
Although you have been using the Google Map for a long time, you probably didn’t notice that there’s an embed code that can be used to embed the map to your WordPress site.
First, as usually, type in your location. Then, look at a link icon as circled on image below. Then, simply copy the given embed code and paste it to your WordPress site.
Using WordPress plugin
The bad thing about embedding the Google Maps using the given embed code is that it won’t be cached, so you will notice signiticant impact to the loading page of your site.
Our favorite plugin for adding Google Maps to WordPress sites is Simple Google Maps Short Code. The plugin uses WordPress HTTP API and Transients API to make sure the maps are cached so your site will run smooth and fast.
After activating the plugin, you may display the Google Maps on any post or page using the
[pw_map address="yourlocation"] shortcode. The shortcode also accepts height and width parameters to resize the map.
Can you use the shortcode on widgets? I don’t see why you can’t. However, to use the shortcode in widgets, you may need use the filter below:
What’s your preferred method? Hope this tutorial helped you to embed Google Maps to your site.
Leave a Reply