Home / Admin / Customize Action Scheduler Retention Period
Duplicate Snippet

Embed Snippet on Your Site

Customize Action Scheduler Retention Period

This snippet allows you to change the default 30-day storage for the Action Scheduler retention period.

Code Preview
php
<?php
/* Customize the Action Scheduler Retention Period  
 * 
 * Original doc: https://wpmailsmtp.com/docs/how-to-troubleshoot-action-scheduler-issues-wp-mail-smtp-2-1-1/
*/
function custom_as_retention_period() {
	// Changes default 30-day retention to 7-days
    return WEEK_IN_SECONDS;
}
add_filter( 'action_scheduler_retention_period', 'custom_as_retention_period' );

Comments

Add a Comment