Skip to content
GravityKit
Buy
Sign in
0 items
  • Plugins

    GravityKit All Access

    Our complete Kit of essential tools for extending and enhancing Gravity Forms—everything you need to build powerful web apps and workflows.

    Learn more
    • GravityView Pro

      GravityView Pro

      Bestseller

      Get Live Filters, Maps, DataTables, the Advanced Elementor Widget and every other Pro feature to build the app your process needs.

    • GravityView

      GravityView

      Trending

      Display Gravity Forms entries on the frontend of your site and build powerful web applications.

    • GravityImport

      GravityImport

      Trending

      Import entries from CSV files into Gravity Forms to transfer data, create new forms, or update existing entries.

    • GravityEdit

      GravityEdit

      Quickly edit Gravity Forms entries inline to save time, reduce clicks, and streamline your workflow.

    • GravityCharts

      GravityCharts

      Trending

      Turn Gravity Forms entries into interactive charts and graphs.

    • GravityActions

      GravityActions

      Update multiple Gravity Forms entries at once, send bulk emails, and streamline your workflow.

    • GravityCalendar

      GravityCalendar

      Turn Gravity Forms entries into dynamic calendars to showcase events, schedules, appointments, and more.

    • GravityExport

      GravityExport

      Export Gravity Forms entries to Excel, CSV, PDF, or Google Sheets, then share them with secure links or deliver them to cloud storage on a schedule.

    • GravityMath

      GravityMath

      Perform advanced calculations on Gravity Forms entries to display totals, averages, or build custom calculators.

    • GravityRevisions

      GravityRevisions

      Track, compare, and restore changes made to Gravity Forms forms and entries with a full version history.

    • GravityMigrate

      GravityMigrate

      Migrate all Gravity Forms data between sites, including forms, entries, settings, Views, feeds, and file uploads, and import forms from other form plugins.

    • GravityBoard

      GravityBoard

      Manage projects with collaborative project management. Coordinate with your team and streamline your workflows.

    • GravitySearch

      GravitySearch

      Search Gravity Forms entries across every form from one screen.

  • Ideal For

    • Nonprofits
    • Web Agencies
    • Education
    • Developers
    • Small Businesses
    • Startups
    Explore All Use Cases

    Case studies

    • Be There Local
    • Killer Shorts
    • West Fork Schools
    • Princeton University
    • BrightLeaf Giving
    • Jacksonville Port Authority
    • National Severe Storms Lab
    • Leadpal
    View All Case Studies
  • Resources

    • Blog
    • Case studies
    • Newsletter
    • GravityKit vs competitors
    • Live Demos
    • Documentation
    • Developer docs
    • GravityKit Academy

    Ultimate guides

    • How to use Gravity Forms
    • Editing Gravity Forms entries
    • Importing Gravity Forms entries
    • Exporting Gravity Forms entries
    • Displaying Gravity Forms entries
    • Gravity Forms conditional logic
    • Gravity Forms calculations
    View More Articles
  • Support
  • Pricing
  • Plugins

    • GravityView Pro

      GravityView Pro

      Bestseller

      Get Live Filters, Maps, DataTables, the Advanced Elementor Widget and every other Pro feature to build the app your process needs.

    • GravityView

      GravityView

      Trending

      Display Gravity Forms entries on the frontend of your site and build powerful web applications.

    • GravityImport

      GravityImport

      Trending

      Import entries from CSV files into Gravity Forms to transfer data, create new forms, or update existing entries.

    • GravityEdit

      GravityEdit

      Quickly edit Gravity Forms entries inline to save time, reduce clicks, and streamline your workflow.

    • GravityCharts

      GravityCharts

      Trending

      Turn Gravity Forms entries into interactive charts and graphs.

    • GravityActions

      GravityActions

      Update multiple Gravity Forms entries at once, send bulk emails, and streamline your workflow.

    • GravityCalendar

      GravityCalendar

      Turn Gravity Forms entries into dynamic calendars to showcase events, schedules, appointments, and more.

    • GravityExport

      GravityExport

      Export Gravity Forms entries to Excel, CSV, PDF, or Google Sheets, then share them with secure links or deliver them to cloud storage on a schedule.

    • GravityMath

      GravityMath

      Perform advanced calculations on Gravity Forms entries to display totals, averages, or build custom calculators.

    • GravityRevisions

      GravityRevisions

      Track, compare, and restore changes made to Gravity Forms forms and entries with a full version history.

    • GravityMigrate

      GravityMigrate

      Migrate all Gravity Forms data between sites, including forms, entries, settings, Views, feeds, and file uploads, and import forms from other form plugins.

    • GravityBoard

      GravityBoard

      Manage projects with collaborative project management. Coordinate with your team and streamline your workflows.

    • GravitySearch

      GravitySearch

      Search Gravity Forms entries across every form from one screen.

    View All Products

    GravityKit All Access

    Our complete Kit of essential tools for extending and enhancing Gravity Forms—everything you need to build powerful web apps and workflows.

    Learn more
  • Ideal For

    • Nonprofits
    • Web Agencies
    • Education
    • Developers
    • Small Businesses
    • Startups
    Explore All Use Cases

    Case studies

    • Be There Local
    • Killer Shorts
    • West Fork Schools
    • Princeton University
    • BrightLeaf Giving
    • Jacksonville Port Authority
    • National Severe Storms Lab
    • Leadpal
    View All Case Studies

    How to build...

    • Client Portal
    • AI-Built Directory
    • Conference Website
    • WordPress CRM
    • Admin Dashboard
    • Inventory Management
    • Vendor Portal
    • Document Library
    View All Guides
  • Resources

    • Blog
    • Case studies
    • Newsletter
    • GravityKit vs competitors
    • Live Demos
    • Documentation
    • Developer docs
    • GravityKit Academy

    ultimate guides

    • How to use Gravity Forms
    • Editing Gravity Forms entries
    • Importing Gravity Forms entries
    • Exporting Gravity Forms entries
    • Displaying Gravity Forms entries
    • Gravity Forms conditional logic
    • Gravity Forms calculations
    View More Articles
  • Support
  • Pricing
0 items

Search

Results appear automatically as you type.
Loading results…

results found matching

    Sign in
    Buy

    Docs

    • Docs Home

    Gravity Forms Add-Ons

    • GravityView
    • GravityActions
    • GravityBoard
    • GravityCalendar
    • GravityCharts
    • GravityEdit
    • GravityExport
    • GravityImport
    • GravityMath
    • GravityRevisions
    • GravitySearch
    • GF Widget for Elementor
    • GF Dynamic Lookup
    • GF Entry Tags
    • GF Event Field
    • GravityExport Lite
    • GF Zero Spam
    • GravityMigrate

    GravityView

    • Getting Started
    • View Setup
    • FAQ
    • Pre-Sale
    • Advanced
    • Common Problems
    • Customizing Your Views
    • Edit Entry
    • Entry Approval
    • Filter and Sort Results
    • Gravity Forms
    • Merge Tags
    • Roles and Capabilities
    • Search
    • Shortcodes
    • View Settings
    • WordPress Posts

    General Help

    • Account, Invoices, and Billing
    • License Related
    • Plugins and Settings
    • Agency accounts
    • Contact
    • Docs Home
    • Gravity Forms Add-Ons

      • GravityView
      • GravityActions
      • GravityBoard
      • GravityCalendar
      • GravityCharts
      • GravityEdit
      • GravityExport
      • GravityImport
      • GravityMath
      • GravityRevisions
      • GravitySearch
      • GF Widget for Elementor
      • GF Dynamic Lookup
      • GF Entry Tags
      • GF Event Field
      • GravityExport Lite
      • GF Zero Spam
      • GravityMigrate
    • GravityView

      • Getting Started
      • View Setup
      • FAQ
      • Pre-Sale
      • Advanced
      • Common Problems
      • Customizing Your Views
      • Edit Entry
      • Entry Approval
      • Filter and Sort Results
      • Gravity Forms
      • Merge Tags
      • Roles and Capabilities
      • Search
      • Shortcodes
      • View Settings
      • WordPress Posts
    • General Help

      • Account, Invoices, and Billing
      • License Related
      • Plugins and Settings
      • Agency accounts
    • Contact

    GravityView Pro

      • Selling listings and featured spots that end on their own
      • Showing entries added since a user’s last login
      • Showing only paid entries: filtering a View by payment status
      • (Advanced) What changed from 1.x to 2.0?
      • Advanced Filter shows no entries, or fewer than expected
      • Field Conditional Logic
      • Field Conditional Logic doesn’t hide entries
      • Filtering a View using the Assignee field from Gravity Flow
      • Filtering by entry approval status
      • Filtering by the week of the year
      • Getting started with Advanced Filtering
      • How to show only entries created by the currently logged-in user
      • How to show only entries from the current day, week, month, or year
      • I can’t type a relative date in an Advanced Filter condition
      • Showing only entries created by users with a certain role
      • The :disabled_admin merge tag modifier
      • Using Advanced Filtering with Multiple Forms
      • Why can’t I see the Fields dropdown?
      • Change the search parameter from “letter” to something else
      • Configuring the A-Z Filters Widget
      • The “Use this field to filter entries” setting
      • Choosing which fields show in the dashboard and on your website
      • Dashboard Views: Display the View title
      • Dashboard Views: How to modify the menu icon
      • Dashboard Views: The included CSS Frameworks
      • Getting started with Dashboard Views
      • Controlling column widths and pinning columns in DataTables
      • Fixing a DataTables View that shows “This table could not load” or stays on “Loading data…”
      • Adding a company logo to DataTables PDF exports
      • Buttons (DataTables Setting)
      • Changing the style of the export buttons in DataTables
      • Customizing DataTables options in GravityView
      • DataTables Data Processing Mode (AJAX or Preloaded)
      • DataTables Field Filters
      • DataTables: is it possible to exclude fields from printing?
      • Displaying a DataTables View from a theme template
      • Enable Auto-Update (DataTables Setting)
      • Getting started with the DataTables Layout
      • Grouping rows by common field values
      • How a DataTables View sorts its entries
      • How to change the separator in DataTables CSV exports
      • How to customize the “Loading data” text
      • How to customize the Excel export file name
      • How to disable the “Loading data” message
      • How to translate the DataTables script
      • Is there a way to style the PDF on DataTables?
      • Making links clickable in DataTables PDF exports
      • Multi-sorting columns in DataTables
      • My column widths aren’t being respected when using Responsive Tables
      • My DataTables View is not sorting properly
      • Removing HTML tags from DataTables Excel exports
      • Removing the striped background from DataTables
      • Responsive (DataTables Setting)
      • Scroller (DataTables Setting)
      • Showing images and URLs in DataTables printouts
      • Showing images in DataTables PDF exports
      • Showing URLs in DataTables Excel exports
      • The Save Table State setting in DataTables
      • The text inside a column is going out of the screen
      • DIY Layout: Remove the “Go back” link
      • DIY Version 2.2 changes to HTML output
      • Getting started with the DIY Layout
      • How do I add additional container tag default options?
      • Showing Before and After Content even when field is empty
      • Getting started with the Advanced Elementor Widget for GravityView
      • Understanding the “Show Debug Output” option
      • How Move Featured Entries to Top works
      • Rank featured listings and sell featured spots
      • Getting started with Featured Entries
      • How to always display featured entries, regardless of search results
      • How to feature an entry using PHP
      • How to visually highlight featured entries in the Recent Entries widget
      • Show only featured entries in the Recent Entries widget
      • Style featured entries with CSS
      • Allowing users to delete entries when using a Magic Link
      • Fields not appearing in Edit Entry when using Magic Links?
      • Getting started with Magic Links
      • Magic Links filters
      • Preserving Magic Links parameters on password-protected Views
      • The {gv_magic_link} merge tag
      • Enabling 3D maps in the Maps Layout
      • My map won’t zoom in past a certain level
      • Showing distance and sorting by distance in radius search results
      • About custom map icons or markers
      • About GravityView Maps geocoding
      • Adding your Google Maps API Key into Divi
      • Adding your Google Maps API Key into Premium Addons for Elementor
      • Adding your Google Maps API Key into Ultimate Addons for Elementor
      • Associating a custom map pin icon (marker) with a field value
      • Can I use Maps to autocomplete addresses on my form?
      • Changing the address that GravityView Maps geocodes
      • Configuring info boxes in GravityView Maps
      • Enabling autocomplete for the Gravity Forms Address field
      • Enabling the REST API access
      • Error: Google Maps API warning: NoApiKeys
      • Error: This page can’t load Google Maps correctly
      • Fixing a conflict with UberMenu plugin
      • Getting started with the Maps Layout
      • Google Maps Javascript API Error “RefererNotAllowedMapError”
      • Granting Google Cloud Access to Support
      • How can I make the marker link to open in a new tab?
      • How can I pull the address from a field type that is not Address?
      • How do I display only the Map? I don’t want to display the entries under the Map.
      • How to enable and configure map marker clustering
      • How to enable radius search
      • How to hide map elements using CSS
      • How to override geocoding coordinates
      • How to show markers from multiple address fields on a map
      • Is it possible to style the map?
      • My map is gray and there are no entry markers
      • Radius Search: Request Location
      • Setting up Google Maps API keys for GravityView Maps
      • Support for OpenStreetMap or other map providers
      • Using a latitude and longitude fields to position the map markers
      • What are “Search as map moves” and “Redo search in map”?
      • Why aren’t some of my entries showing up on the map?
      • [Advanced] How to modify Ratings & Reviews entry comment titles
      • Changing the star titles shown on hover
      • Creating a review/voting system by embedding a form into a single entry (short)
      • Getting started with Ratings & Reviews
      • How to disable email notifications for reviews
      • Issue: GravityView Single Entry page only shows “Leave a Reply”
      • Ratings & Reviews Anonymous Reviews
      • Ratings & Reviews Hooks
      • Ratings & Reviews Merge Tags
      • Keeping Views with Prevent Direct Access out of XML sitemaps
      • Getting started with Social Sharing & SEO
      • Setting up SEO for Views with Yoast SEO
      • Setting up sharing buttons with JetPack
      • Getting started with PDF for GravityView
      • Using unions in Multiple Forms
      • Getting started with Multiple Forms
      • How to join a Nested Forms parent form to its child form
      • I don’t see the option to join multiple forms
      • Known limitations of Multiple Forms
      • Multiple Forms: How the “Strict Entry Match” setting works
      • Multiple Forms: Searching entries
      • Using Advanced Filtering with Multiple Forms
      • Why does my View show the same entry more than once?
      • Adding Live Filters to a View
      • Getting started with Connected Views
      • Using the Connections Map
      • Setting an editing deadline with Edit Window
    • Home
    • Docs
    • GravityView Pro
    • Maps Layout
    • Showing distance and sorting by distance in radius search results

    Showing distance and sorting by distance in radius search results

    Estimated reading: 2 minutes

    Updated on November 11, 2026

    In a View with a radius search, the Distance field shows how far each entry is from the searched location. A View setting lists the nearest entries first.

    Before you start #

    • Maps is built into GravityView Pro. To turn it on or off, go to Plugins and click Features in the GravityView Pro row.
    • On a GravityView + Extensions (Legacy) license, Maps is a separate plugin, and the Distance field and distance sorting need version 3.9.0 or later of it. About the “GravityView + Extensions (Legacy)” license shows how to install it.
    • Your View needs a radius search. How to enable radius search sets one up.

    How distance is measured #

    Distance is measured in a straight line between the searched location and the entry’s position on the map, as the crow flies. A route by road is usually longer.

    The unit follows the search:

    • A search in miles shows distances in miles, such as 2.8 mi.
    • A search in kilometers shows them in kilometers, such as 4.5 km.

    Step 1: Show the distance for each entry #

    1. Edit your View. In the Multiple Entries Layout tab, click Add Field in the area where the distance should show. In a Table View, the button is Add Table Column.
    2. Choose Distance.
    The View editor's field picker filtered to Distance
    1. Click the gear icon on the new field to open its settings. Set Decimal places to the number of digits after the decimal point, from 0 to 5. The default is 1.
    The Distance Settings window with Decimal places set to 1
    1. Click Update.

    During a radius search, each entry now shows its distance, such as 0.4 mi. Without a radius search, the field stays empty.

    Note: Only the Multiple Entries Layout offers the Distance field. The Single Entry Layout doesn’t list it.

    Step 2: Sort results by distance #

    1. Edit your View. In the Settings box, click the Maps tab.
    2. Under Radius Search Settings, turn on Sort radius search results by distance in the Radius Distance Sorting row.
    Radius Search Settings on the Maps tab, with Sort radius search results by distance turned on
    1. Click Update.

    The order now depends on the search:

    • During a radius search, the nearest entries come first, and the order continues across all pages of results.
    • Without a radius search, the View keeps its own sort order.

    Entries at exactly the same distance follow the View’s own sort order. Distances are compared before rounding, so entries that show the same rounded value still appear nearest first.

    A 5-mile radius search around 1001 Farnam Street in Omaha, listing the nearest members first with their distance

    The Distance field or the sorting setting is missing #

    • Look for the Distance field in the Multiple Entries Layout tab. The Single Entry Layout doesn’t offer it.
    • Look for the sorting setting in the Maps tab of the Settings box, under Radius Search Settings.

    Changing how the distance looks #

    The gk/gravitymaps/fields/distance/output filter changes the text the Distance field shows. This example adds the word “away” after every Distance field value on your site:

    /**
     * Adds the word "away" after the Distance field value.
     *
     * @param string $output   The distance and its unit, for example "2.4 mi".
     * @param float  $distance The distance in the unit of the search.
     * @param string $unit     The unit of the search: "mi" or "km".
     *
     * @return string The text the Distance field shows.
     */
    function gk_distance_away( $output, $distance, $unit ) {
        return $output . ' away';
    }
    add_filter( 'gk/gravitymaps/fields/distance/output', 'gk_distance_away', 10, 3 );

    Note: Adding custom PHP code snippets to your website shows where to add this code.

    The filter also passes a fourth parameter. Its developer documentation page describes what it holds.

    Still stuck?

    How can we help?

    "*" indicates required fields

    This field is for validation purposes and should be left unchanged.
    Replies will go to this email.
    How can we help?*
    My pre-sale question is related to...*
    My WordPress skills are....*
    My Gravity Forms skills are...*
    You will be shown articles from our documentation.
    Vous pouvez nous écrire dans votre langue maternelle si c’est plus facile pour vous—nous nous occuperons de la traduction!
    Puedes escribirnos en tu idioma nativo si te resulta más fácil; ¡nosotros nos encargamos de la traducción!
    Sie können uns in Ihrer Muttersprache schreiben, wenn das für Sie einfacher ist – wir kümmern uns um die Übersetzung!
    U kunt ons in uw moedertaal schrijven als dat gemakkelijker voor u is — wij zorgen voor de vertaling!
    Du kan skrive til oss på ditt morsmål hvis det er enklere for deg — vi tar oss av oversettelsen!
    Du kan skriva till oss på ditt modersmål om det är lättare för dig — vi tar hand om översättningen!
    Você pode nos escrever em seu idioma nativo se for mais fácil para você — nós cuidaremos da tradução!
    Puoi scriverci nella tua lingua madre se ti è più facile — penseremo noi alla traduzione!
    Please provide as much detail as you're able; this helps us provide you with faster support.
    Drop files here or
    Accepted file types: jpg, jpeg, gif, png, tiff, pdf, bmp, zip, json, csv, xls, xlsx, Max. file size: 256 MB.
      Get better at Gravity Forms every Friday

      Was this page helpful?

      Table Of Contents
      • Before you start
      • How distance is measured
      • Step 1: Show the distance for each entry
      • Step 2: Sort results by distance
      • The Distance field or the sorting setting is missing
      • Changing how the distance looks
      GravityKit
      • How to Build It
      • GravityKit vs competitors
      • Pricing
      • Products
      • Our Team
      • Our Values
      • Work With Us
      • Partner Directory
      • Coupons
      Support
      • Support
      • Contact
      • Documentation
      • Scope of Support
      • Brand Guidelines
      • Brand Kit
      • Privacy Policy
      • Terms of Service (“Terms”)
      I am a...
      • Nonprofit
      • Web agency
      • Small business owner
      • Web developer
      • Educational institution
      • WordPress freelancer
      • Startup founder
      • One-person agency
      Get notified of updates.

      We’re constantly improving GravityKit. Fill out your email below and we’ll notify you anytime major updates drop.

      See past editions
      • Facebook
      • Twitter
      • Mastodon
      GravityKit is a Gravity Forms Certified Developer.

      Copyright © 2026, Katz Web Services, Inc.

      GravityKit and GravityView are registered trademarks of Katz Web Services, Inc.