-
As stated above, your
orderby
parameter should be set tometa_value
, notrestaurant
. -
Using phpMyAdmin or some other tool, look at your database. With any newer installation of WordPress, your tables should have a collation of
utf8mb4_unicode_ci
. That means that the table is storing its data in UTF-8 4-byte unicode character set. That “ci” at the end means “case insensitive”.
If your collation is not correct, then you may need to convert your data. This is not as easy as it sounds all the time, so make sure you get a quality backup of your database first.
Related Posts:
- Ignoring initial articles (like ‘a’, ‘an’ or ‘the’) when sorting queries?
- Return only Count from a wp_query request?
- Use REGEXP in WP_Query meta_query key
- Sorting: custom query with orderby meta_value_num THEN by title
- Order by DESC, ASC in custom WP_Query
- How to prevent execution of default query, while preserving ability to use WP_Query in template?
- Sort posts by category name and title
- How to get order of posts?
- How to get Page/Post Gallery attachment images in order they are set in backend using WP_Query()?
- WP Query orderby meta key natural sort?
- Get posts by menu ID
- Slow SQL_CALC_FOUND_ROWS Query
- Loop through all tags & output posts in alphabetical list
- SQL query equivalent to WP User Query
- What’s wrong with this WP query?
- Stop all SQL_CALC_FOUND_ROWS wordpress queries
- How to count post meta key values for all posts in database
- Sorting Posts by custom field
- Group posts by meta_key
- How to search for posts IN OR title OR content OR author?
- Sorting meta_value as integer doesn’t work
- WP_Query hit max joins… How else can I build a search function that uses custom fields?
- Sort in WP_Query(), not filter? Is it possible?
- Would this post meta be better added to the post table rather than post_meta table
- Front End Sorting Questions
- Woocommerce custom loop to show all the products [closed]
- Sort by meta key on archive page
- Order By Multiple Meta Fields
- meta_query on a date range using an array of values
- How to speed up wp_query, took more 5s to run against 100k posts
- How to sort posts in admin by titles with dd.mm.yyyy format?
- Query Set Order By Author
- WordPress: Keep order of query_posts list of post ID’s using post__in
- SQL User Query by Multiple Roles using PHP
- WordPress Query is taking more then 20 second and stuck on creating index
- How to make orderby ‘meta_value_num’ OPTIONAL?
- Meta query with order by another custom field
- Get the Plugin Which Triggered a MySql Query in WordPress?
- Mysql query LIKE not working
- How to get posts on a specific date – WP Query
- Using WP_Query and WP_Meta_Query Outside of WordPress
- How to orderby meta_value_num with dollar ($) sign
- SQL query injection with fifu image
- Customize the Sorting Dropdown in WooCommerce use another list or more page
- Order (by ASC) posts with meta_key so posts without values are last
- How to sort store location by specific category order in WP store locations
- how to include orderby value that is empty?
- Why last row deleted when refresh page
- How to sort wordpress posts already selected by WP_QUERY
- WP Query – grouping posts by same meta key, adding together values from another key
- Woocommerce Get Orders By Meta Value
- Sort by price wpdb
- SQL to join u3g_users & u3g_meta_value with repeating data
- Custom Woocommerce Product Query
- How sort products by calculate value? ( custom post meta, price, option)
- Get authors list and sort them by recent posts
- Move some posts to end of sort order, even if there is a sort in the wp_Query already
- INNER JOIN custom tables – SQL Query
- use mysql variable in a $wpdb->query to reindex a column?
- One of two similar WP Query is very slow
- Order by value of Custom Field using url string
- Fix wp_term_relationships slow query in get_posts
- WP Query with meta queries
- WordPress Query optimaization for slow query
- Sorting query_posts() with a complex orderby filter
- Order 2 meta_queries differently in WP_Query?
- Sort posts on custom field AND after that sort on date?
- How to mix two orderby-parameters into one ordered result
- Query postmeta based on meta_value, return array of post_id
- Sorting Posts by Taxonomy thats not within the query’s $args
- Order Posts By Custom Field That is an array of objects
- Multiple wpostmeta.meta_key
- Ignoring ‘a’ when sorting posts
- Slow query when selecting with large meta query or post__in
- Display three sequential posts on each page load, without repeating previous
- Combine WP_Query with array of custom data to single loop without breaking the pagination
- Wrap group of wp query posts to parent div by date/year
- Sorting posts by meta values: 2 different orders
- WP_Query always returning the last custom post
- Sorting is not working in WordPress WP_Query
- How to sort a WP_Query array by post_name after an array_merge();
- Get a list of the last posts grouped by author and filtered by category
- Sorting: custom query with orderby meta_value_num THEN by title
- query_posts with sorting on a custom datestamp
- How to count post meta key values for all posts in database
- meta_query dates from an array
- Sort Posts with custom meta key by default which is currently set as optional
- Different sql queries count indicator on the main page [closed]
- Parsing External Table Arguments
- How to add a custom field and incrementing value for all the published posts
- wordpress sorting using array merge by price in ascending order but price with 0 must be show last
- WordPress query very slow on +/- 300k DB entries and 7 INNER JOIN
- have_posts order by title descending
- WP_Query – order with usort by custom meta
- SQL query into to WP query
- Bulk delete comments, foreach loop
- Sort by multiple columns using get_posts
- WP Query order posts not working
- How to `’orderby’ => ‘meta_value_num’` in a series of orderby parameters
- query loop “inherit query from template” prevents setting sort order