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

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.

Screenshot of the Settings metabox with the Filter & Sort tab active.

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


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

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.

  1. Sort by secondary field: Select the field to use as a tiebreaker
  2. 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

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:

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.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us