SQL query to delete expired WooCommerce Sessions.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
|delete from t1, t2|
|using wp_options t1|
|join wp_options t2 on t2.option_name = replace(t1.option_name, '_expires', '')|
|where (t1.option_name like '\_wc\_session\_expires\_%')|
|and t1.option_value < UNIX_TIMESTAMP(NOW())|