View Categories

How to Remove or Disable Phone and Email in the Store Locator Frontend

Sometimes you may want to hide contact details (Phone/Email) from the Store List and/or the InfoBox on the frontend. In Agile Store Locator, you can do this in two main ways:

  1. Data API level (WordPress filter) – removes Phone/Email from the store data output globally. Agile Store Locator WordPress Plugin
  2. Template level (Customizer) – removes (or edits) the Phone/Email markup from the List/InfoBox templates. Agile Store Locator WordPress Plugin

Method 1: Remove Phone/Email at the Data API Level (Recommended) #

This method removes the values from the dataset before the Store Locator renders, so Phone/Email won’t appear anywhere the template tries to print them. This uses the plugin’s WordPress hooks/filters system. Agile Store Locator WordPress Plugin

Add this code to your theme’s functions.php (or a custom plugin):

function remove_asl_phone_email_data($all_stores) {

  foreach($all_stores as $store) {

    $store->phone = '';
    $store->email = '';
  }

  return $all_stores;
}

add_filter('asl_filter_stores_result', 'remove_asl_phone_email_data');

Notes

  • This is a global approach (affects list + infobox + anywhere the store data is used).
  • Best when you want Phone/Email removed site-wide without editing templates. Agile Store Locator WordPress Plugin

Method 2: Remove Phone/Email from the Template (Customizer) #

This method removes Phone/Email from the rendered HTML by editing the template in the Store Locator Customizer. Agile Store Locator WordPress Plugin

Remove from the Store List Template #

  1. Go to ASL Settings → Customizer. Agile Store Locator WordPress Plugin
  2. Select the Template you’re using.
  3. Select the List Section.
  4. Find and remove the Phone/Email blocks (example below), then Save.
{{if phone}}
    <li class="sl-phone">
        <i class="icon-mobile"></i>
        <a href="tel:{{:phone}}">{{:phone}}</a>
    </li>
{{/if}}
{{if email}}
    <li class="sl-email">
        <i class="icon-mail"></i>
        <a href="mailto:{{:email}}">{{:email}}</a>
    </li>
{{/if}}

Remove from the InfoBox Template #

Repeat the same steps but open the Infobox Section in the Customizer and remove the Phone/Email markup there as well. Agile Store Locator WordPress Plugin

Notes

  • This approach is best when you want more control (hide in list, but keep in infobox, etc.).
  • Template changes are purely frontend display changes. Agile Store Locator WordPress Plugin

Convert Phone into a CTA Button Without Showing It #

If you want to hide the phone text but still provide a “Call Now” button, you can do it in the List Section template.

  1. Go to ASL Settings → Customizer
  2. Select your template
  3. Open the List Section
  4. Remove the Phone <li> block and place a CTA button inside the action buttons container.

Use this pattern (keep it inside the action buttons container):

<div class="sl-act-btns mt-3">
    <a class="btn btn-asl s-direction">[Directions]</a>

    {{if phone}}
    <a target="_blank" href="tel:{{:phone}}" class="btn btn-asl">[Call Now]</a>
    {{/if}}

    {{if link}}
    <a target="{{:target}}" class="btn btn-asl btn-asl-outline s-visit-website" href="{{:link}}">[Website]</a>
    {{/if}}

    {{if dist_str}}
    <div class="sl-miles">
        <span class="s-distance">{{:dist_str}}</span>
    </div>
    {{/if}}
</div>