SQL – Update regular prices on WooCommerce

BACKUP DATABASE BEFORE EXECUTE THE QUERIES

UPDATE wp_postmeta AS t1
INNER JOIN wp_postmeta AS t2 ON
t2.post_id = t1.post_id AND t2.meta_key = '_regular_price' SET t1.meta_value = t2.meta_value
WHERE t1.meta_key = '_price';
DELETE FROM wp_postmeta WHERE meta_key = '_sale_price';
DELETE FROM wp_postmeta WHERE meta_key = '_sale_price_dates_to';
DELETE FROM wp_postmeta WHERE meta_key = '_sale_price_dates_from';

as seen on https://www.webdesign101.net/remove-woocommerce-sale-prices/ by LEONID BEILIS

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.