Skip to content

Instantly share code, notes, and snippets.

@AlexanderPoellmann
Created October 11, 2015 17:52
Show Gist options
  • Save AlexanderPoellmann/f1c367980cd5c7551f63 to your computer and use it in GitHub Desktop.
Save AlexanderPoellmann/f1c367980cd5c7551f63 to your computer and use it in GitHub Desktop.
Clean up your database by deleting ALL (!) woocommerce sessions and ALL (!) transients. Use with caution!
DELETE FROM `wp_options` WHERE `option_name` LIKE ('%\wc_session\_%')
DELETE FROM `wp_options` WHERE `option_name` LIKE ('%\_transient\_%')
@alextegelid
Copy link

You should probably add an underscore after the first backslash. Otherwise it'll trigger on any word (\w)...

DELETE FROM `wp_options` WHERE `option_name` LIKE ('%\_wc_session\_%')
                                                      ↑

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment