Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

WordPress Orderby Numeric Value Not Working

The plugin ‘Post Types Order‘ was the culprit. As Scribu pointed out above the plugin is filtering the Raw SQL query which it shouldn’t be doing. As a result, the argument ‘suppress_filters‘ wasn’t stopping the query being modified and the ‘orderby‘ argument was being completely ignored.

As to how this behavior can be stopped, I’m not sure. I solved my issue by disabling the plugin as it wasn’t even being used. However, you can set the order of your custom post type menus in your register_post_types code instead, using the ‘menu_position‘ argument which decides where the menu will be placed.

Documentation for ordering your post types in the WordPress admin menu can be found here in the official WordPress documentation.

The lesson learned here is that you should always assume that a plugin has broken something, especially if you are using code from the official documentation that works.

Related Posts:

  1. Prioritize posts in query by meta keys?
  2. Returning a custom content types with meta values
  3. post type => ‘any’ not applied my custom queries
  4. Linking posts together with Advanced Custom Fields “both ways”
  5. Query Posts From Multiple Post Types
  6. Query all posts where a meta key does not exist
  7. Meta query with boolean true/false value
  8. Get the ID of the latest post
  9. Get post with multiple meta keys and value
  10. How to use a custom post type as front page?
  11. Custom Queries: Joining On Meta Values From Two Custom Post Types
  12. How Do I Use WP_Query to Run This Database Query as Search Result?
  13. Querying Posts by Taxonomy From Alternate Network Site
  14. Query by 2 values of a repeater ACF field
  15. Wp-query causing problems with the_content();
  16. How to create posts (not post template) to be displayed on projects page?
  17. Can’t sort order of wp_query with 2 meta keys
  18. Comparing timestamps in meta query doesn’t work
  19. Display two post types ordered by two custom fields
  20. Query for posts from any post type but only add instock products
  21. Querying Term Posts in Loop
  22. Use get_post_types to query only custom posts types
  23. is there a way to retrieve posts that do not have a featured image assigned?
  24. orderby in custom WP Query does not work
  25. How to add post_type=value when editing that post type in the WordPress admin?
  26. Display custom post type from dynamic custom field
  27. Show the same Article Available in Other Categories
  28. Storing posts from query and accessing later via AJAX call
  29. convert custom query to wp_query
  30. Show custom post type filtered by category
  31. Search / Filter posts on Title/Content OR Tags
  32. Get latest 3 posts from multiple CPT in one query
  33. Post image in WordPress not appearing on home page
  34. Meta query for custom post type ignored in main query
  35. Update Post Meta for a logged in user
  36. Two Custom Post Types Many to Many Relationship
  37. creat filter with wp_query
  38. Several post types on WP Query by tag and taxonomy
  39. Update postmeta Parent when post_status child change
  40. WordPress request fiter order by related post’s post_title
  41. First custom field value (out of several) displayed twice after query
  42. How to get all tags of a custom post type by id
  43. WP_Query orderby and tax_query
  44. Different Ways to Query Custom Post Types?
  45. Showing specific post in order of array wp_query
  46. WP the_posts() on single-cars.php get category link
  47. Different Limit number of post on different archive page
  48. Custom post types and ‘new WP_Query’
  49. WP_Query() with custom post type and taxonomy — get all terms?
  50. Displaying a div from an assigned meta_value when on a page
  51. Variable not working in WP_Query
  52. How to get specific post meta by title or id
  53. wp_post_delete is deleting all offices
  54. SEARCH QUERIES – REVERSE OUTPUT
  55. How do I insert a custom post type query after a certain number of recent posts and then resume recent posts?
  56. WP_Query for custom taxonomies showing posts from non-specified terms?
  57. Custom meta fields not showing up in WP_Response Object via custom endpoint
  58. How to get post by meta value
  59. WP_Query with all posts in one custom post type and only posts in another custom post type with a specific category
  60. How to properly get the wp_postmeta.meta_value of a custom post type in specifics?
  61. How do I get all authors posts of a custom post type outside loop
  62. minimize wp_query call to database
  63. How can I group by Taxonomy on Custom Post Type while filtering out based on custom Meta
  64. subtracting the current post form then whole loop, which is generating all CPT titles
  65. Custom Post By Category
  66. Custom post Query and WordPress Post Query Clash
  67. How to get the posts that my following users are liked?
  68. update a posts of other custom post type
  69. Get post from Category by Priority
  70. Most efficient way of showing children posts?
  71. Only show current category post
  72. How to get Current week and current date record wp query
  73. How to get post meta for custom post type and taxonomy
  74. get_post_meta for Custom Post Type ( CPT )
  75. Get posts of an specific term of a custom taxonomy
  76. Conditional posts in WP_query for search
  77. How To Loop Through list with Custom Post Types
  78. Query Pulling the same post twice
  79. Is it possible to add query parameters on the archive page?
  80. meta query always fails even if data is correct
  81. Calling specific page with wp query
  82. WordPress custom post type
  83. Edit post meta direct from post.php?
  84. Custom Post Type meta oembed html output resulting in WSoD
  85. Values inside a custom field to determine which category posts to display
  86. How to create content automatically when a post is published?
  87. Display a post count from a custom metabox selection
  88. Query Only Show Text on Posts With Certain Taxonomy Tag
  89. Retrieving IDs of child pages which are in a different post type
  90. Query child posts on parents single.php?
  91. WordPress can only query up to 766
  92. Change display wp post type to wp custom post type
  93. Post content stays the same but permalink changes ?
  94. Retrieve post data via WPDB class
  95. Dynamically change post_parent in every page load?
  96. Top 30 Songs using Custom Post Type
  97. Querying meta values within an array
  98. Filter Custom post type by another Custom post type
  99. Create a list of months based posts
  100. Cannot exclude particular post from loop of custom post type
Categories custom-post-types Tags custom-post-types, post-meta, posts, query, wp-query
Is it possible to have WordPress not recognize category URLs?
Displaying year, month and day archives differently

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress