# Result ordering

```
Search Sources -> Ordering
```

![](/files/FjAyPNVqtSA77hy84XZY)

On this options page you can change the individual and mixed result ordering.

## Primary and secondary main ordering

```
Search Sources -> Ordering -> Result Ordering
```

This option will change the ordering of items in the same result type group. Default is "Date descending".

![](/files/C2s0ePWlLRLoR53f8BaK)

*Also note, that this is only a secondary ordering, as Relevance is the primary. You can disable relevance ordering on the Relevance Options panel.*

### Ordering by custom fields

When choosing Custom field based primary or secondary ordering, two other fields will pop up:

* *Custom field name* - The name of the custom field.
* *Type* - Numeric or String (date type fields will work with both options)

![](/files/z9mScPjWnOWy7mR82AC1)

#### Most common custom fields

This list will contain some of the most used custom fields, use it in the 'custom field name' section.

* WooCommerce price fields: \_*price, \_sale\_price, \_regular\_price*&#x20;
* The Events Calendar dates: \_*EventStartDate, \_EventEndDate*
* Events Manager dates: \_*event\_start, \_event\_end*

## Post type ordering

By default all post type results (posts, page, products etc..) are ordered as one group, regardless of the post type itself.

If you want to prioritize certain post type over others - for example display product results first, then posts, pages etc.. - then make sure to enable post type group ordering.

![](/files/nfTwuTLIixhmmTRHAByJ)

## Mixed content ordering

```
General Options -> Ordering -> Mixed results order
```

If more than one result type group is active then you can order these groups here.

For example you have a search configured for **Posts** and **BuddyPress activities**. You want the BuddyPress Activities displayed first. In this case you will need to drag the **"bp\_activities"** item above the **"post\_page\_cpt"** item:

![](http://i.imgur.com/WTcWHRM.png)

### The items in the list explained

* **terms** - categories and terms
* **post\_page\_cpt** - posts, pages and every custom post type
* **blogs** - blog results (blogs as result)
* **comments** - comment results
* **bp\_activities** - BuddyPress activities
* **bp\_groups** - BuddyPress groups
* **bp\_users** - BuddyPress users


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.ajaxsearchpro.com/general-settings/result-ordering.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
