Troubleshooting //
Generating Google Maps Itinerary Link From Address Meta Field

Generating Google Maps Itinerary Link From Address Meta Field

Question

I displayed the address on the front end, but I would also like to add a “Get itinerary” link to that address which will open on Google Maps in a _blank tab. How to generate the Google Maps link from my CPT address meta field?

Answer

There is an easy way to generate a Google Maps itinerary link from a meta field with an address with the help of the JetEngine plugin.

Requirements:

  • JetEngine plugin installed and activated;
  • a created CPT.

To generate Google Maps itinerary link from address meta field please follow the steps below:

Go to the WordPress Dashboard > JetEngine > Post Types directory and open the needed Post Type.

Proceed to the Meta Field section and create an address meta field.

address meta field

Also, ensure you have the meta fields of the posts filled with data.

meta fields with data

Move to the page where you want to add the Google Maps itinerary link. Search for the Dynamic Link widget and drag and drop it to the page.

dynamic link widget

In the Source field, select the address meta field you created before.

address meta field

Move on to the URL Prefix field and insert the following link – https://maps.google.com/?q= – into it.

URL prefix of the dynamic link

Lastly, scroll down and enable the “Open in new window” toggle.

open in new window toggle

Moreover, you can change the label and style up the widget according to your needs.

customized widget

On the front end, the link will have the exact address you put into the meta field of the CPT post.

address link

Once the user clicks on it, the address will be opened on Google Maps in a new window.

google maps itinerary link

Was this article helpful?
YesNo
Still need help?
Submit a request