Using a range to search numeric fields
The Search Bar in GravityView can search a number field by a range. Visitors then find the entries between a lowest and a highest value, such as the jobs that pay $60,000 to $95,000. These input types search by range:
- Slider: visitors drag one or two handles along a track, or type in the boxes below it. The track runs from the lowest to the highest value in the View’s entries, rounded out to round numbers, so visitors see the range before they search.
- Number range: two boxes, From and To, that visitors fill in.
Both run the same search, so the same values return the same entries.
With GravityView Pro, Live Filters has a range filter for Number fields too. It puts the slider in a sidebar next to the entries and updates the results as visitors move a handle. Use the Search Bar inputs on this page when the range is part of a search that visitors fill in and then submit.
Which fields support a range search #
Each input works with these field types:
| Field | Slider | Number range |
|---|---|---|
| Number | Yes | Yes |
| Quantity | Yes | Yes |
| Total | Yes | Yes |
| Payment Amount | Yes | Yes |
| Product with a user-defined price | No | Yes |
| Price of a Single Product field | No | Yes |
For a Single Product field, add its Price input to the Search Bar. A range search on the Single Product field itself finds no entries.
Method 1: Range slider #
The slider shows a track for each field, with handles visitors drag to set the range.

Step 1: Add a number field to the Search Bar
- Open your View and click the gear on the Search Bar widget. Search Bar Settings opens. If the View has no Search Bar yet, see Configuring the Search Bar widget.
- Click Add Search Field and choose a supported field, such as a Number field.
Step 2: Set the input type to Slider
- Click the gear next to the field in Search Bar Settings.
- Set Input type to Slider.
- Choose a Slider type: Minimum and maximum for two handles, Minimum only for one At least handle, or Maximum only for one Up to handle.
- Close Search Bar Settings and click Update.

The slider works with no other changes. The settings below are optional.
Step 3: Adjust the slider settings (optional)
To change these settings, click the gear next to the field in Search Bar Settings. They are listed below Slider type, and clicking Update on the View saves them.
| Setting | What it does |
|---|---|
| Minimum value | Sets the lowest value on the track. Leave it empty to use the lowest value in the View, rounded down. |
| Maximum value | Sets the highest value on the track. Leave it empty to use the highest value in the View, rounded up. |
| Step | Sets how far a handle moves at a time, for example 10000 for salaries. Leave it empty to fit the step to the field’s values. The step must be greater than zero. Any other value is ignored. |
| Show number inputs below the slider | Shows a box under each handle where visitors can type a value. It’s on by default. When it’s off, the values show as text under the track. |
| Format numbers with thousands separators | Shows 38,000 instead of 38000, in the boxes and in the values under the track. It’s on by default. Turn it off for values such as years, so 2026 doesn’t show as 2,026. |
| Unit prefix | Adds text before each value, such as $. A currency field shows its currency symbol on its own, and a prefix you enter replaces it. |
| Unit suffix | Adds text after each value, such as km or hrs. |
Minimum value is hidden when the slider type is Maximum only, and Maximum value is hidden when it’s Minimum only. With one handle, the other end of the track always comes from the View’s entries.
The slider has no Default Value setting. It opens at the two ends of the track, and the View lists every entry until the visitor searches.
How the slider behaves for visitors
- The track spans only the entries the visitor can see. If a View shows each user only their own entries, each user’s slider runs from the lowest to the highest of their own values.
- Visitors can search with the keyboard. Tab to a handle and press the arrow keys to move it one step, or hold Shift to move it about a tenth of the track. The arrow keys also work in the number boxes.
- The slider fits at phone width, with no sideways scrolling.
- A View with no entries shows two plain number boxes in place of the slider, because there are no values to build the track from. The slider appears once the View has entries.
- The searched values stay in the page address, for example
filter_4[min]=60000&filter_4[max]=95000, so visitors can bookmark or share a search. See Linking to search results.
Using more than one slider
When the Search Bar has several fields, its search mode decides how they combine. A new Search Bar matches any field. A search for a salary range and at least 40 hours then lists every job in the salary range, plus every job of 40 hours or more.
To list only the entries that match every slider, add the Search Mode field to the Search Bar. Its Search Mode setting starts at Match All Fields, and as a Hidden Field visitors don’t see it. Configuring the Search Bar widget has more on search mode.
Method 2: Number range #
The Number range input shows two boxes, From and To, for each field. Use it for Product fields, which can’t use the slider, or when you’d rather visitors type exact values.
Step 1: Set the input type to Number range
- Add a supported field to the Search Bar, as in Method 1, Step 1.
- Click the gear next to the field in Search Bar Settings and set Input type to Number range.
- Close Search Bar Settings, click Update, and open your View.

How the number range behaves for visitors
The boxes accept decimals, except on Quantity fields, which take whole numbers. The up and down arrow keys change the value by 1.
A visitor can fill in only one box:
- With From empty, the View lists the entries at or below the To value.
- With To empty, the View lists the entries at or above the From value.

Watch the video demo
Customizing the number step increment
To change how far the Number range boxes move with each step (for example, to allow increments of 0.5), use the gk/gravityview/search/number-range/step filter:
/**
* Sets the step of the Number range boxes in the Search Bar.
*
* @param string $step The step. Defaults to '1' for Quantity fields
* and 'any' for other fields.
*
* @return string The new step.
*/
add_filter( 'gk/gravityview/search/number-range/step', function ( $step ) {
return '0.5';
} );Note: Adding custom PHP code snippets to your website explains where this code goes.
The slider has its own Step setting, described in Method 1, Step 3.