Title: Order by numeric custom field using shortcode
Last modified: June 16, 2022

---

# Order by numeric custom field using shortcode

 *  Resolved [Reed Sutton](https://wordpress.org/support/users/reedus33/)
 * (@reedus33)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/order-by-numeric-custom-field-using-shortcode/)
 * We have a custom field representing a value in dollars. Trying to order from 
   highest to lowest, however because meta_value is treated as a string, its showing
   $900 as higher than $1600. Is there a way to order by numerical value properly
   using the PODs shortcode?
 * Shortcode:
    [pods name=”credit_card” orderby=”net_value_travel.meta_value DESC”
   limit=”5″ where=”rewards_program.meta_value=’Aeroplan'” template=”credit-card-
   table”]
 * Page:
    [https://frugalflyer.ca/credit-card/cibc-aeroplan-visa-infinite-privilege/](https://frugalflyer.ca/credit-card/cibc-aeroplan-visa-infinite-privilege/)
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Forder-by-numeric-custom-field-using-shortcode%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Jory Hogeveen](https://wordpress.org/support/users/keraweb/)
 * (@keraweb)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/order-by-numeric-custom-field-using-shortcode/#post-15746925)
 * Hi [@reedus33](https://wordpress.org/support/users/reedus33/)
 * See here:
    [https://stackoverflow.com/questions/16519648/sql-for-ordering-by-number-1-2-3-4-etc-instead-of-1-10-11-12](https://stackoverflow.com/questions/16519648/sql-for-ordering-by-number-1-2-3-4-etc-instead-of-1-10-11-12)
 * Cheers, Jory
 *  Thread Starter [Reed Sutton](https://wordpress.org/support/users/reedus33/)
 * (@reedus33)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/order-by-numeric-custom-field-using-shortcode/#post-15747479)
 * Great the cast function works. Thanks.
 *  Plugin Author [Jory Hogeveen](https://wordpress.org/support/users/keraweb/)
 * (@keraweb)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/order-by-numeric-custom-field-using-shortcode/#post-15751743)
 * No problem!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Order by numeric custom field using shortcode’ is closed to new replies.

 * ![](https://ps.w.org/pods/assets/icon.svg?rev=3286397)
 * [Pods - Custom Content Types and Fields](https://wordpress.org/plugins/pods/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/pods/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/pods/)
 * [Active Topics](https://wordpress.org/support/plugin/pods/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pods/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pods/reviews/)

## Tags

 * [find](https://wordpress.org/support/topic-tag/find/)
 * [meta value](https://wordpress.org/support/topic-tag/meta-value/)
 * [numerical](https://wordpress.org/support/topic-tag/numerical/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * 3 replies
 * 2 participants
 * Last reply from: [Jory Hogeveen](https://wordpress.org/support/users/keraweb/)
 * Last activity: [3 years, 11 months ago](https://wordpress.org/support/topic/order-by-numeric-custom-field-using-shortcode/#post-15751743)
 * Status: resolved