update wp_posts set menu_order=100 where post_type='product';
update wp_posts set menu_order=5 where post_name='r-m-williams-craftsman-boot_792c678e';
update wp_posts set menu_order=10 where post_name='r-m-williams-rod-polo_ee292998';
update wp_posts set menu_order=15 where post_name='r-m-williams-3-piece-solid-hide-belt';
update wp_posts set menu_order=20 where post_name='r-m-williams-mulyungarie-fleece';
update wp_posts set menu_order=25 where post_name='r-m-williams-3-piece-solid-hide-belt_65cae4a4';
update wp_posts set menu_order=30 where post_name='r-m-williams-ramco-jean';
update wp_posts set menu_order=35 where post_name='r-m-williams-rod-polo_e7890444';
update wp_posts set menu_order=40 where post_name='r-m-williams-saddler-duffle-bag';
update wp_posts set menu_order=45 where post_name='r-m-williams-parson-t-shirt_c6692481';
update wp_posts set menu_order=50 where post_name='r-m-williams-akubra-cattleman-hat_94e4511c';
update wp_posts set menu_order=55 where post_name='r-m-williams-signature-long-sleeve-t-shirt';
update wp_posts set menu_order=60 where post_name='r-m-williams-comfort-craftsman-boot_17e56e86';

 

UPDATE wp_options SET option_value = replace(option_value, 'www.mydomain.com','www.newdomain.com') ;
UPDATE wp_posts SET post_content = replace(post_content, 'www.mydomain.com','www.newdomain.com') ;
UPDATE wp_comments SET comment_content = replace(comment_content, 'www.mydomain.com', 'www.newdomain.com') ;
UPDATE wp_comments SET comment_author_url = replace(comment_author_url, 'www.mydomain.com', 'www.newdomain.com') ;


修改产品库存:

update wp_postmeta set meta_value=1000 where meta_key='_stock';
update wp_postmeta set meta_value='instock' where meta_key='_stock_status';

 

删除产品或订单

delete from wp_woocommerce_order_items where order_id in (select id from wp_posts where post_type='shop_order');
delete from wp_wc_product_meta_lookup where product_id in(select id from wp_posts where post_type='product');
delete from wp_postmeta where post_id in(select id from wp_posts where post_type='shop_order' or post_type='product');
delete from wp_posts where post_type='shop_order' or post_type='product';