---
title: "Sorting results by field value"
date: 2026-04-23
author: "GravityKit"
link: "https://www.gravitykit.com/docs/gravityview/filter-and-sort-results/sorting-results-by-field-value/"
---

Learn how to sort your View entries by any field—text, numbers, dates, or randomly.

### 1. Edit the View you want to sort

On the All Views page, click on the View you wish to sort.

![Cursor hovering over 'Edit' next to a 'Business Listings' title](https://www.gravitykit.com/wp-content/uploads/2018/01/edit-the-view-you-want-to-sort.png?1432159114)

### 2. Find the Filter & Sort tab in the Settings box

Scroll down below the View editor. You'll see a Settings box with multiple tabs. Click the **Filter & Sort** tab.

If you can't see the Settings box, it may be hidden; [here's how to show it](https://www.gravitykit.com/docs/gravityview/common-problems/the-settings-box-is-hidden/).

![Screenshot of the Settings metabox with the Filter & Sort tab active.](https://www.gravitykit.com/wp-content/uploads/2026/04/MsVffK.png)

### 3. Choose what field to sort by

Select the field you want to use for sorting. GravityView handles different field types automatically:

- **Text fields** (Name, Address, etc.): Sorted alphabetically
- **Number fields** (Quantity, Price, etc.): Sorted by numeric value
- **Date fields** (Date Created, Custom Date, etc.): Sorted chronologically
- **Entry ID**: Sorted chronologically

![Screenshot of 'Sort by field' setting dropdown open](https://www.gravitykit.com/wp-content/uploads/2026/04/TKFxGv.png)

### 4. Choose the sort direction

| Direction | Text Fields | Number Fields | Date Fields |
|---|---|---|---|
| **ASC** (Ascending) | A → Z | 1 → 100 | Oldest → Newest |
| **DESC** (Descending) | Z → A | 100 → 1 | Newest → Oldest |
| **Random** | Random order | Random order | Random order |

![Sort direction dropdown open](https://www.gravitykit.com/wp-content/uploads/2026/04/QxHUso.png)

### 5. (Optional)
*Add secondary sorting*
If you need to sort by a second field when entries have the same value in the primary field, use the secondary sort settings. The secondary field acts as a tiebreaker when multiple entries have the same value in the primary field.

- **Sort by secondary field**: Select the field to use as a tiebreaker
- **Secondary sort direction**: Choose ASC, DESC, or Random

**Example:** Sort a directory by Last Name (primary), then by First Name (secondary) so that "Smith, Alice" appears before "Smith, Bob".

### 6. Save the View

Click **Update** to save your sorting settings.

![Update button in Publish box](https://www.gravitykit.com/wp-content/uploads/2026/04/4VD173.png)

## Troubleshooting

### Random sorting not working?

Some managed WordPress hosts (including WP Engine, Kinsta, and Flywheel) disable the `ORDER BY RAND()` MySQL function for performance reasons.

**Solutions:**

- [Enable random sorting on WP Engine](https://www.gravitykit.com/docs/gravityview/common-problems/random-sorting-not-working-on-wp-engine/)
- Contact your host's support to ask about enabling `ORDER BY RAND()`

### Dates not sorting correctly?

Make sure your date field uses a consistent format. If dates are stored as text (rather than a Date field type in Gravity Forms), they may sort alphabetically instead of chronologically.