Created
September 29, 2016 17:31
-
-
Save nathanielks/1997f3694d1c644c46021c515b764151 to your computer and use it in GitHub Desktop.
SQL query to delete expired WooCommerce Sessions.
This file contains hidden or 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()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Be sure to update
wp_
to whatever the prefix is for your database. This deletes all expired sessions in your options table. Doesn't touch the wc_sessions table.