Bug #19975


Deleted and spammed sites are still able to create and trigger scheduled tasks

Added by Raymond Hoh 3 months ago. Updated 3 months ago.

Priority name:
Category name:
Target version:
Start date:
Due date:
% Done:


Estimated time:
Deployment actions:


When I was looking into #19971 to trim down the Cavalvade scheduled tasks, I noticed that deleted sites such as or sites marked as spam are still able to create and trigger scheduled tasks.

We should prevent scheduled tasks from being created for deleted / spammed sites.

Actions #1

Updated by Raymond Hoh 3 months ago

On production, I've put in place a potential fix for this.

After this line in wp-content/mu-plugins/cavalcade.php, I've added the following:

// If site is deleted or is spam, do not allow any job from this site.
$site = get_site();
if ( 1 === (int) $site->deleted || 1 === (int) $site->spam ) {
    return true;

I've also added a clause to omit 'delete_expired_transients' jobs here :

// Remove expired transients task as we're using an object cache.
case 'delete_expired_transients' :

This task is for sites without an object cache , but it always runs even if an object cache is in use: Since we're running an object cache, should be safe to ignore this job.

I will probably commit these changes later today.

Last night, the Cavalcade queue was pretty much gone, but as of now, the lag is about 12 mins. Will look to see what else we can do.

Actions #2

Updated by Raymond Hoh 3 months ago

  • Status changed from New to Resolved

I've committed the deleted and spammed site scheduled task fix in and the 'delete_expired_transients' task fix in

This is deployed on production. Just checked the Cavalcade queue and the lag at the moment is less than a minute.


Also available in: Atom PDF