Title: Sort by Meta fields using URL
Last modified: August 21, 2016

---

# Sort by Meta fields using URL

 *  [michaeljmac](https://wordpress.org/support/users/michaeljmac/)
 * (@michaeljmac)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/sort-by-meta-fields-using-url/)
 * I’m sorting a list of posts by using a simple url format:
    1.  ?orderby=title&orderby=post_parent&order=ASC
 * at the end of my main page, which would normally just list of posts by date posted.
 * The above works perfect. Also, the previous and next work along with that perfectly.
 * However, when I try to use meta data fields, it doesn’t work:
    1.  ?meta_key=_count-views_all&orderby=meta_value_num&order=DESC
 * It doesn’t actually sort by the count views listed in the database.
 * I’ve looked at the all the numbers and I actually can’t figure out how it’s sorting,
   because it’s different than the regular link without the parameters.
 * Any ideas on why this is happening?
 * Thanks!!!!

The topic ‘Sort by Meta fields using URL’ is closed to new replies.

## Tags

 * [post](https://wordpress.org/support/topic-tag/post/)
 * [sort](https://wordpress.org/support/topic-tag/sort/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [michaeljmac](https://wordpress.org/support/users/michaeljmac/)
 * Last activity: [12 years, 10 months ago](https://wordpress.org/support/topic/sort-by-meta-fields-using-url/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
