You can use ORDER BY rand(), but it’s a very heavy query as a temporary table is created for it.
A WC_Product_Query or a WP_Query could be a good alternative to WPDB custom query. Both support 'orderby' => 'rand',…
Related Posts:
- Get WooCommerce product attribute taxonomies in a SQL query on WordPress database
- How to get all products from an order including variations via SQL query?
- get woocommerce product image url and price from database [closed]
- Update WooCommerce stock status with SQL query if stock value is greater than 0
- How to get products without tag?
- Woocommerce change the price of products in the database
- Query product’s image path by category WooCommerce database?
- How to speed up “My Account > Orders Page” on Site with More than 200,000 orders?
- Alter the cost of products using phpmyadmin sql query
- Woocommerce order_complete email dont send after changing order status via sql
- Use a woocommerce hook to create a table and populate it with a query
- Is it possible to extract all product columns except for one?
- How to get current product category ID in product archive page
- WooCommerce prices location in DB
- WP/WooCommerce REST API cart/checkout/order [closed]
- Fatal Error when installing woocommerce despite upgrading
- Adding an action within a function that is being called by add_filter
- Hide Add to Cart Button
- How to modify “[Product] has been added to your cart” in WooCommerce?
- woocommerce fail to replace template string in email title [closed]
- Why do Woocommerce templates use hooks rather than get_template_part
- Woocommerce checkout via external page [closed]
- Change font size in products listing pages in woocommerce
- How to stop a Gutenberg Block from firing multiple GET Requests?
- WooCommerce customer account multiple emails
- WooCommerce Product Page css
- Get the name of all the Items of cart in current session
- Change WordPress Site Title and Tagline and WooCommerce settings using ACF [closed]
- remove categories from product
- Woocommerce: custom loop in product tabs breaks reviews tab
- Category Tree In WooCommerce Product API
- Programatically Remove Item from Cart Not Working – Needs Page Refresh
- How to delete 1000s of duplicated images in WordPress?
- Set default value field meta_Value [closed]
- Woocommerce Product Import Automation
- Get posts from subcategory by parent category slug
- how to get jetpack’s infinite scroll to work with woocommerce?
- remove default pagination on woocommerce shop page
- WordPress Comment Box on woocommerce product page [closed]
- Remove Bulk Action For non admin user
- Add max-value to hooked quantity selector in woocommerce [closed]
- Can’t remove woocommerce sidebar
- woo product , wp_insert_post() never displays on the front end. What gives? [closed]
- Single product page doesn’t display price
- Should I use docker in wordpress production?
- Unable to paste google analytics con header.php [closed]
- can’t get the product id in single woocommerce page
- Php echo woocommerce price
- Different files for order details
- Multiple Schema.org markups on a single product page
- WooCommerce get_author_posts_url() – Author URL redirecting to shop base
- Error message if user is buying less than 200 euros of a given product [closed]
- WooCommerce show a variation both in check boxes and in a list
- Woocommerce – How to mix products and posts on a landing page?
- Disable woocommerce product search plugin’s autocomplete [closed]
- Add sub variations in product page
- Woo commerce product quantity wise SKU
- Override une fonction dans une class Woocommerce
- What to do if images are not displayed in mob. versions of the online store on wordpress?
- WooCommerce (Bookings) + AddOns not always calculating correctly the total
- Woocommerce order proceed hooks
- List of JS events in the WooCommerce frontend
- WooCommerce custom product type not saving with namespaces
- Add shortcode to show woocommerce shipping class name on product template
- Redirecting orders by company field
- Upload file to Woocommerce Order
- wp_login overriding user meta data
- woocommerce REST api on the website’s front-end
- Woocommerce List categories with Image thumbnail
- How to add (and change the font of) the short product description to order page and customer’s new order e-mail [closed]
- Display WOO Commerce products on HTML page?
- How to add custom text field inputs for attributes in backend?
- Get unsolved array keys of product data tabs in woo product editor page
- Show products as posts on archive page
- Woocommerce new shop page
- Add class to latest item Woocommerce
- WooCommerce: how to set stock per attribute on variable product
- How to display products in sidebar in 2 columns?
- Replace “Add to cart” by a link to contact page on specific product
- Adding price to woocommerce cart item with get_price gets multiplied with 3?
- Increase load-out-page speed
- WooCommerce Stucked (?) – Edit dimensions
- Use Product Attribute in conditional tag
- Admin – Custom Post Type in WooCommerce menu – how to control menu order
- Facing issue in Woocommerce 3.3 version in wordpress
- getting attributes in a product loop
- Update products, terms and relations via SQL
- How to Display Amount of products being displayed out of the amount in category – WordPress/Woocommerce
- How to programatically create a WooCommerce downloadable product?
- Echo SKU in WooCommerce Conformation page [closed]
- Custom sender email address for specific WooCommerce product
- Adding Extra Customer Email In Woocommerce Checkout
- How to override email text New Customer Order?
- How do I create a array custom field for use with facetwp.com?
- How to add my theme’s style to woocommerce blocks?
- Get a customer’s phone number by woocommerce
- Insert a custom field as a second email address to a completed order in WooCommerce
- Want to add Number of Products added by each shop manager in users list
- Titles with thumbnails in media library
- WooCommerce Webhook Action When a New Product Review was Submitted/Created