Woocommerce uses the post_type product
for products, so it should be easy enough to search for those instead of posts.
Just look out for the proper post_type
.
You could filter the revisions using a self-joined select like this:
SELECT *
FROM `wp_posts` p1
LEFT JOIN `wp_posts` p2 ON (p2.post_parent = p1.ID and p1.post_type="products")
WHERE p1.`post_type` = "revision"
LIMIT 50
Still, I wouldn’t convert my revisions into posts nor anything like that. You’ll end up with TONS of garbage posts laying around.
Related Posts:
- How to select WooCommerce products by post_meta and order them
- Setting All Drafts to ‘exclude-from-catalog’ in WooCommerce
- Get WooCommerce product details and transfer them to a custom DB table
- Sum the total amount of a specific product purchased per user and display in table
- email alert for product availability
- WordPress WP_Query without query GET parameters
- Modify WooCommerce used to get all orders in dashboard
- Convert a column of a table containing an Array as response in HTML
- How to import woocommerce custom fields data into another site?
- append data to mysql table via submit button coded in php – not working
- How to set variable to specific field when querying
- Fatal error: Call to undefined function mysql_connect()
- the_date() not working
- How to return number of found rows from SELECT query
- How to correctly add Javascript in functions.php
- How to make WordPress plugin check for database changes and then do something?
- How to remove “out of stock” variation options from size dropdown in woocommerce?
- Woocommerce: How to override core functions in functions.php?
- Successful or Error Message after running mysql code in functions.php
- Get WooCommerce shipping methods programmatically
- Add a custom text field to WooCommerce admin product data “Variations”
- Translating add to cart woocommerce button [closed]
- PHP/MySQL issues when running WP on EC2 cloud [closed]
- WordPress get pagination on wpdb get_results
- Looking for most performant way to execute several similar WP queries within shortcodes
- Help with some php math in WordPress
- How do I display a user’s previous orders as a select box option on a product?
- Show MySQL errors that occur when I excute $wpdb->insert()
- combine Code 1 with Code 2
- Is XAMPP faster than running LAMP in WSL on Windows 10? [closed]
- Get updated query results on page after insert in database
- WordPress not reflecting changed of the database
- Automated Cart Update With Alert Box Each Time
- How can I fix WordPress installation errors?
- Two Different Links for Same Product – WooCommerce [closed]
- WooCommerce/WordPress: how hide entire table form after submit (Admin Dashboard)?
- Show prices with tax in Woocommerce Mini Cart [closed]
- Problem with custom plugin using AJAX to pull info from php file
- Woocommerce related product text
- Is it possible to intercept all ajax requests and get the parameters and the returns?
- How to make products with no cost in WooCommerce
- How to split links generated into an xml sitemap to avoid exceeding 30 sec maximum execution time?
- Hacked WordPress website /Homepage redirect [closed]
- Refresh table data with Ajax
- Database query works fine outside WordPress
- Large Woocommerce Site (83,000 items), What Can I Do? [closed]
- Help with a $wpdb MySQL Query
- How i can obtain all the post meta for a specific post as an array?
- Can’t Query Custom Table Using $wpdb Method
- $wpdb returns duplicate posts
- Update postmeta after theme switch
- Creating Database Table vs. Adding MetaData to Post & User
- Add product to cart for user – WC()->cart->add_to_cart [closed]
- Seo Friendly Filter URLs
- how can i add class or span tag at sprintf?
- Display attribute on shop page after the title
- WooCommerce – Moving Product Price to the Left of Add to Cart Button [closed]
- Where to copy woocommerce files to in my custom theme to avoid editing the core plugin?
- Have Woocommerce show product price if id, when not logged in
- Query the links Database
- WooCommerce Query Product Titles
- Display Results of SQL Query on WP site
- How to add a shortcode which runs a .php file for the current post
- Run a sql (update) after 12 hours after the user login. Woocommerce users
- PHP Warning: mysqli_query(): after updating my websites php from 5.6 to 7.2
- How can I change the background color of divs dynamically (depending on an order-status in woocommerce)?
- Use Search Term in html link and redirect
- How to get content on a blank basket/cart page in a custom theme with woocommerce
- How to display MySQL table data which is stored as an array?
- WooCommerce REST API AJAX Auth – 401 response
- Looping through and combining calls to Woocommerce REST API
- Woocommerce – if selected attribute term equals
- split 1 cart item into instock and back ordered
- Adding a widget under an ‘Add to Cart’ button through a PHP snippet
- Woocommerce Related Product by 2 taxonomy
- Hide price excluding tax when price is empty
- Woocommerce variation with radio button + price
- Display text of price (minus 20%) on every product page in a sentence.
- WordPress WPDB::insert 13th param is always blank (only if format)
- Ajax not updating to database
- How do I prevent a folder from reappearing in my home directory?
- can’t delete a row from post_meta table
- jQuery doesn’t work in my php snippet
- MySQL query in WordPress with AJAX
- retrieve wordpress post-meta using php not wordpress functions
- Splash pages on a high traffic site
- How to add custom checkout field in user details mail template
- Add specific phrase after every product title including the discounted price? [closed]
- Display Sale Price Before Regular Price (WooCommerce)
- Submit cf7 form to cfdb as pdf/BLOB [closed]
- WooCommerce – Show ‘Sales’ badge on variable products where only some variations have sales price [closed]
- How to create a container in php then customise it in CSS
- Show button in header when product custom field is not empty
- WordPress 6.1.1 UTF8 Slug Limit Increase
- Woocommerce Convert existing order to the cart
- How to add SKU and remove product title from WooCommerce url?
- Product Search in search.php
- using custom pages for myaccount in woocommerce
- Putting form result in my database
- How can I update a value of a field depending on outside source?