Location-based WordPress Menus – 5 min setup

Set up dynamic menus based on the user's location: continent, country, state, city, or timezone.
location-based menu

Use cases

  • Include a dynamic menu item that points to the visitor’s nearest branch.
  • Direct users to country-specific help centers or language-specific support articles.
  • Country-specific pricing or shop – show menu items that link to the appropriate shop domain.

Step-by-step: How to set up location-based menu item

The setup involves two main steps: (1) creating a trigger that defines the locations and their corresponding menu items, and (2) adding that trigger to your WordPress menu.

  1. Download and activate the If-So Dynamic Content plugin.
  2. On your WordPress dashboard, go to If-SoAdd New Trigger. Screenshot
  3. In version A, select the geolocation condition and choose the location(s) where the dynamic menu item will appear. Screenshot
  4. In the version A content field, switch the WYSIWYG editor to Code mode and paste the HTML line below, while replacing https://example.com with the page URL you want the menu item to lead to and Item Name with your desired label. Screenshot
<a href="https://example.com">Item Name</a>
  1. On your WordPress dashboard, go to AppearanceMenus.
  2. Click Custom Links to add a new custom menu item, paste the trigger’s shortcode in the Link Text field, and enter # in the URL field. Screenshot

Screenshots

add a new trigger 1
Create a trigger
Select location(s)
HTML code
Add the link HTML code
Custom link
Add the trigger as a custom link in your menu

Didn’t find what you need?

Winter Sale!
Up to 40% Off