Skip to content

Instantly share code, notes, and snippets.

@lukecav
Created June 16, 2026 17:04
Show Gist options
  • Select an option

  • Save lukecav/7df0485abeea72ca2369795d98f46ebf to your computer and use it in GitHub Desktop.

Select an option

Save lukecav/7df0485abeea72ca2369795d98f46ebf to your computer and use it in GitHub Desktop.
Keeps logs from the last 30 days and deletes anything with a log_date_gmt older than 30 days in the wp_actionscheduler_logs database table
Preview
SELECT COUNT(*)
FROM wp_actionscheduler_logs
WHERE log_date_gmt < NOW() - INTERVAL 30 DAY;
Actual
DELETE FROM wp_actionscheduler_logs
WHERE log_date_gmt < NOW() - INTERVAL 30 DAY;

Comments are disabled for this gist.