{"id":2356,"date":"2026-10-20T08:32:18","date_gmt":"2026-10-20T07:32:18","guid":{"rendered":"https:\/\/wpgeodirectory.com\/documentation\/article\/get-directions-with-full-address\/"},"modified":"2026-10-20T08:40:20","modified_gmt":"2026-10-20T07:40:20","slug":"get-directions-with-full-address","status":"publish","type":"gd_place","link":"https:\/\/wpgeodirectory.com\/documentation\/article\/how-tos\/get-directions-with-full-address\/","title":{"rendered":"How to make Get Directions use the full address instead of coordinates"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The GD > Directions block links to Google Maps with the listing&#8217;s latitude and longitude. To send visitors to Google Maps with the street address instead, build the link yourself with the GD > Post Badge block, which can put any listing field into its link.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Add a directions button with the address<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Edit your details page template (GeoDirectory > Settings > General > Pages shows which page that is) and add this shortcode where you want the button, or add a GD > Post Badge block with the same settings:<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-markup\">&#091;gd_post_badge key=&quot;street&quot; condition=&quot;is_not_empty&quot; badge=&quot;Get Directions&quot; icon_class=&quot;fas fa-location-arrow&quot; color=&quot;primary&quot; new_window=&quot;1&quot; link=&quot;https:\/\/www.google.com\/maps\/dir\/?api=1&amp;destination=%%street_encode%%,%%city_encode%%,%%region_encode%%,%%zip_encode%%,%%country_encode%%&quot;&#093;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The badge only shows when the listing has a street address. Each <code>%%field_encode%%<\/code> tag is replaced with that field&#8217;s value, URL encoded, so Google receives a normal address search. You can drop parts you do not need, for example the zip code.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Then remove the GD > Directions block from the template so visitors do not see two buttons.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Variables you can use in the link<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Any listing field works with this pattern: <code>%%key%%<\/code> inserts the raw value and <code>%%key_encode%%<\/code> inserts it URL encoded. The address keys are <code>street<\/code>, <code>street2<\/code>, <code>city<\/code>, <code>region<\/code>, <code>zip<\/code> and <code>country<\/code>. <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/core-widgets\/gd-post-badge\/\">GD > Post Badge<\/a> explains the other badge settings.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If some listings use the private address feature, keep the coordinate based GD > Directions block instead, as this link shows the address to anyone who can see the badge.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The GD > Directions block links to Google Maps with the listing&#8217;s latitude and longitude. To send visitors to Google Maps with the street address instead, build the link yourself with the GD > Post Badge block, which can put any listing field into its link. Add a directions button with the address Edit your [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"article\/tags":[],"article\/categories":[211,432],"class_list":["post-2356","gd_place","type-gd_place","status-publish","hentry","gd_placecategory-tips-tricks-more","gd_placecategory-how-tos"],"_links":{"self":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/2356","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article"}],"about":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/types\/gd_place"}],"author":[{"embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/comments?post=2356"}],"version-history":[{"count":2,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/2356\/revisions"}],"predecessor-version":[{"id":2647,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/2356\/revisions\/2647"}],"wp:attachment":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/media?parent=2356"}],"wp:term":[{"taxonomy":"gd_place_tags","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/tags?post=2356"},{"taxonomy":"gd_placecategory","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/categories?post=2356"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}