WordPress Woocommerce change all products to out of stock

Hello i have a online shop using WordPress and Woocommerce but i have the following problem. I need to change all of my 2000 products to be out of stock, i haven’t selected any quantity i only need to change the status. I started doing it by hand but it will take quite a while to mark all the items. After browsing the net i saw that this can be done relatively easy in phpmyadmin, the status is stored in wp_postmeta, i myself tried fiddling with the queries of phpmyadmin but to no avail . Can someone help me with building the query that i need to use ? I use WP 4.1.1

Related posts

Leave a Reply

1 comment

  1. ok bro write this query in your db

    Update wp_postmeta Set meta_value = 'outofstock' Where meta_value = 'instock' And meta_key = '_stock_status'
    

    I restricted update query more by using And meta_key = '_stock_status'

    Hope this will help you … don’t worry query is completely right but you must take a DB backup