Created
June 16, 2026 17:04
-
-
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
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
| 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.