WordPress filter hook

action_scheduler_retention_period_for_failed

Defined by Action Scheduler and fired by 33 plugins in total, running on 7.2M+ sites between them.

“Set the retention period in seconds for actions with a failed status. If the action_scheduler_default_cleaner_statuses filter includes a failed status, this filter result will be ignored, and the retention period for failed actions will match that of other statuses.”

How to use action_scheduler_retention_period_for_failed

It's a filter: your callback receives the value, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'action_scheduler_retention_period_for_failed', function( $month_in_seconds ) {
	// Change $month_in_seconds here.
	return $month_in_seconds;
}, 10, 1 );

Argument names come from WooCommerce's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

33 plugins that fire action_scheduler_retention_period_for_failed

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. WooCommerce icon WooCommerce7+ million installs apply_filters( 'action_scheduler_retention_period_for_failed', 3 * $this->month_in_seconds ) packages/action-scheduler/classes/ActionScheduler_QueueCleaner.php:121
  2. FooGallery Photo Gallery : Image, Video & Masonry Galleries icon FooGallery Photo Gallery : Image, Video & Masonry Galleries100,000+ installs apply_filters( 'action_scheduler_retention_period_for_failed', 3 * $this->month_in_seconds ) lib/action-scheduler/classes/ActionScheduler_QueueCleaner.php:121
  3. Site Reviews icon Site Reviews60,000+ installs apply_filters( 'action_scheduler_retention_period_for_failed', 3 * $this->month_in_seconds ) vendors/woocommerce/action-scheduler/classes/ActionScheduler_QueueCleaner.php:121
  4. Easy Digital Downloads icon Easy Digital Downloads40,000+ installs apply_filters( 'action_scheduler_retention_period_for_failed', 3 * $this->month_in_seconds ) libraries/action-scheduler/classes/ActionScheduler_QueueCleaner.php:121
  5. Action Scheduler icon Action Scheduler20,000+ installs apply_filters( 'action_scheduler_retention_period_for_failed', 3 * $this->month_in_seconds ) classes/ActionScheduler_QueueCleaner.php:121
  6. Content Egg icon Content Egg10,000+ installs apply_filters( 'action_scheduler_retention_period_for_failed', 3 * $this->month_in_seconds ) libraries/action-scheduler/classes/ActionScheduler_QueueCleaner.php:121
  7. WPScan icon WPScan8,000+ installs apply_filters( 'action_scheduler_retention_period_for_failed', 3 * $this->month_in_seconds ) libraries/action-scheduler/classes/ActionScheduler_QueueCleaner.php:121
  8. Podcast Importer SecondLine icon Podcast Importer SecondLine4,000+ installs apply_filters( 'action_scheduler_retention_period_for_failed', 3 * $this->month_in_seconds ) lib/action-scheduler/classes/ActionScheduler_QueueCleaner.php:121
  9. Pronamic Pay icon Pronamic Pay2,000+ installs apply_filters( 'action_scheduler_retention_period_for_failed', 3 * $this->month_in_seconds ) packages/woocommerce/action-scheduler/classes/ActionScheduler_QueueCleaner.php:121
  10. WP Event Aggregator: Import Eventbrite events, Meetup events, social events and any iCal Events into Event Calendar icon WP Event Aggregator: Import Eventbrite events, Meetup events, social events and any iCal Events into Event Calendar1,000+ installs apply_filters( 'action_scheduler_retention_period_for_failed', 3 * $this->month_in_seconds ) includes/wpea-action-scheduler/action-scheduler/classes/ActionScheduler_QueueCleaner.php:122
  11. WANotifier for Forms and Actions icon WANotifier for Forms and Actions900+ installs apply_filters( 'action_scheduler_retention_period_for_failed', 3 * $this->month_in_seconds ) libraries/action-scheduler/classes/ActionScheduler_QueueCleaner.php:121
  12. Pronamic Pay with Mollie for Gravity Forms icon Pronamic Pay with Mollie for Gravity Forms300+ installs apply_filters( 'action_scheduler_retention_period_for_failed', 3 * $this->month_in_seconds ) packages/woocommerce/action-scheduler/classes/ActionScheduler_QueueCleaner.php:121
  13. Pronamic Pay with Mollie for Contact Form 7 icon Pronamic Pay with Mollie for Contact Form 7100+ installs apply_filters( 'action_scheduler_retention_period_for_failed', 3 * $this->month_in_seconds ) packages/woocommerce/action-scheduler/classes/ActionScheduler_QueueCleaner.php:121
  14. WebinarIgnition icon WebinarIgnition70+ installs apply_filters( 'action_scheduler_retention_period_for_failed', 3 * $this->month_in_seconds ) inc/lib/action-scheduler/classes/ActionScheduler_QueueCleaner.php:121
  15. Smacks! Simple Importer icon Smacks! Simple Importer50+ installs apply_filters( 'action_scheduler_retention_period_for_failed', 3 * $this->month_in_seconds ) libs/action-scheduler/classes/ActionScheduler_QueueCleaner.php:121
  16. Pronamic Pay with Rabo Smart Pay for WooCommerce icon Pronamic Pay with Rabo Smart Pay for WooCommerce20+ installs apply_filters( 'action_scheduler_retention_period_for_failed', 3 * $this->month_in_seconds ) packages/woocommerce/action-scheduler/classes/ActionScheduler_QueueCleaner.php:121
  17. Pronamic Pay with Mollie for Ninja Forms icon Pronamic Pay with Mollie for Ninja Forms10+ installs apply_filters( 'action_scheduler_retention_period_for_failed', 3 * $this->month_in_seconds ) packages/woocommerce/action-scheduler/classes/ActionScheduler_QueueCleaner.php:121
  18. Bookance Appointment Booking icon Bookance Appointment Booking10+ installs apply_filters( 'action_scheduler_retention_period_for_failed', 3 * $this->month_in_seconds ) libraries/action-scheduler/classes/ActionScheduler_QueueCleaner.php:121
  19. ilGhera Reviso Exporter for WooCommerce icon ilGhera Reviso Exporter for WooCommerce10+ installs apply_filters( 'action_scheduler_retention_period_for_failed', 3 * $this->month_in_seconds ) libraries/action-scheduler/classes/ActionScheduler_QueueCleaner.php:121
  20. ChatBudgie icon ChatBudgie10+ installs apply_filters( 'action_scheduler_retention_period_for_failed', 3 * $this->month_in_seconds ) lib/action-scheduler/classes/ActionScheduler_QueueCleaner.php:78
  21. Pronamic Pay with Mollie for WooCommerce icon Pronamic Pay with Mollie for WooCommerce10+ installs apply_filters( 'action_scheduler_retention_period_for_failed', 3 * $this->month_in_seconds ) packages/woocommerce/action-scheduler/classes/ActionScheduler_QueueCleaner.php:121
  22. DecaCrew icon DecaCrewFewer than 10 installs apply_filters( 'action_scheduler_retention_period_for_failed', 3 * $this->month_in_seconds ) lib/action-scheduler/classes/ActionScheduler_QueueCleaner.php:121
  23. Bulk Email Checker icon Bulk Email CheckerFewer than 10 installs apply_filters( 'action_scheduler_retention_period_for_failed', 3 * $this->month_in_seconds ) lib/action-scheduler/classes/ActionScheduler_QueueCleaner.php:121
  24. Strata Site Audit icon Strata Site AuditFewer than 10 installs apply_filters( 'action_scheduler_retention_period_for_failed', 3 * $this->month_in_seconds ) lib/action-scheduler/classes/ActionScheduler_QueueCleaner.php:121
  25. Blinkimg Image Optimizer: Convert to WebP & AVIF, Compress Images, Same Quality icon Blinkimg Image Optimizer: Convert to WebP & AVIF, Compress Images, Same QualityFewer than 10 installs apply_filters( 'action_scheduler_retention_period_for_failed', 3 * $this->month_in_seconds ) vendor-prefixed/action-scheduler/classes/ActionScheduler_QueueCleaner.php:121
  26. Fast Imagery icon Fast ImageryFewer than 10 installs apply_filters( 'action_scheduler_retention_period_for_failed', 3 * $this->month_in_seconds ) lib/action-scheduler/classes/ActionScheduler_QueueCleaner.php:121
  27. Agentyllo icon AgentylloFewer than 10 installs apply_filters( 'action_scheduler_retention_period_for_failed', 3 * $this->month_in_seconds ) lib/action-scheduler/classes/ActionScheduler_QueueCleaner.php:121
  28. Queue Ajax Calls Performantly icon Queue Ajax Calls PerformantlyFewer than 10 installs apply_filters( 'action_scheduler_retention_period_for_failed', 3 * $this->month_in_seconds ) libraries/action-scheduler/classes/ActionScheduler_QueueCleaner.php:121
  29. Zybroz AI Agents icon Zybroz AI AgentsFewer than 10 installs apply_filters( 'action_scheduler_retention_period_for_failed', 3 * $this->month_in_seconds ) libraries/action-scheduler/classes/ActionScheduler_QueueCleaner.php:121
  30. ilGhera WooCommerce Importer for Reviso icon ilGhera WooCommerce Importer for RevisoFewer than 10 installs apply_filters( 'action_scheduler_retention_period_for_failed', 3 * $this->month_in_seconds ) libraries/action-scheduler/classes/ActionScheduler_QueueCleaner.php:121
  31. Pronamic Pay doneren met Mollie icon Pronamic Pay doneren met MollieFewer than 10 installs apply_filters( 'action_scheduler_retention_period_for_failed', 3 * $this->month_in_seconds ) packages/woocommerce/action-scheduler/classes/ActionScheduler_QueueCleaner.php:121
  32. Performance Optimisation icon Performance OptimisationFewer than 10 installs apply_filters( 'action_scheduler_retention_period_for_failed', 3 * $month ) includes/Database/class-database-cleanup.php:2148
  33. Asyncra Queue Triage for Action Scheduler icon Asyncra Queue Triage for Action SchedulerFewer than 10 installs apply_filters( 'action_scheduler_retention_period_for_failed', 3 * $month ) includes/class-reader.php:216

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.