Adding Driving Directions to Your Website or Blog

Are you trying to figure out how to add driving directions to your website or blog?  If you Google “embed code for driving directions” you will see several results for a Google Gadget that is supposed to do this, but currently, the gadget does not work and no code is generated.

I needed to add driving directions to one of my sites so I dug around and found code that works.  Credit to BillMyers Online.  Here it is:

<form action=”http://maps.google.com/maps” method=”get” target=”_blank”>
<p><label for=”mapsUsSaddr”>Your Address (street, city state)</label>
<input type=”text” name=”saddr” id=”mapsUsSaddr” value=”” size=”20″ />
<input type=”submit” value=”Map It” />
<input type=”hidden” name=”daddr” value=”123 Your Street, City, ST” />
<input type=”hidden” name=”hl” value=”en” /></p>
</form>

Make sure to replace the 123 Your Street, City, ST with your desired destination address.

Here’s what this code will produce:




The “destination” in this example is my office address.  I assume that Google will eventually fix their maps gadget but until they do, this code will do the job.

Inserting Directions Code into WordPress

If you are inserting this code into a WordPress page or post, make sure to select the “text” editor instead of the visual editor.


0 comments… add one

Leave a Comment