Useful SQL queries for wordpress woocommerce Database

Empty table:

TRUNCATE TABLE wp_actionscheduler_actions;
TRUNCATE TABLE wp_actionscheduler_logs;

remove expired sessions from the woocommerce_sessions table

DELETE FROM wp_woocommerce_sessions 
WHERE session_expiry < UNIX_TIMESTAMP();

optimize sessions records from the woocommerce_sessions table

OPTIMIZE TABLE wp_woocommerce_sessions;

In terms of what you can safely clean, the wp_actionscheduler_actions, and wp_actionscheduler_logs tables could be cleared if you don’t need the historical data.

Was this helpful?
YesNo

Leave a Comment