We can use the Cleanup module of Beyond Multisite to find empty, old sites in the WordPress network (and delete them if we want). By an empty site we could mean a lot of things.
Currently the plugin can find empty sites that at the same time:
- have zero published posts and pages, (or with only one post and one page, which could be the default ones)
- have been updated for the last time only 5 minutes after they are created
These two conditions used at the same time are pretty good at finding empty sites. They are not perfect though, and we might improve this in a future version of the plugin. For example if the user adds a page for less than 5 minutes after the site is created and also deletes the default one, this site would be considered empty even though it has a page. Or the site might have drafts, that are not published. So there is room for improvement.
Another thing to keep in mind is this WordPress bug which makes things even worse. This is why the plugin attempts to fix the timezone of the date and time the site was registered.
Keeping these things in mind, here is how to find old empty sites in a WordPress multisite:
- From the Network Admin Screen click on Dashboard -> Network Cleanup
- Scroll down to the Delete Sites section and set the form to these settings on the picture below:
- Set Registered to Older than 730 days (2 years) – Or any other age you want.
- Set Last updated to Less than 5 min after registration
- Set Published posts count to 0 or 1
- Set Published pages count to 0 or 1
- Set Approved comments count to 0 or 1
- Set Skip previously cancelled to No
- Set Deletion type to Permanent deletion
- Set Deletion time and cancellation to No cancellation. Execute now!
- Click Preview Site Deletion
Now you see a list of sites that are most likely empty and just abandoned by their creator quickly after registration.