Drupal

Deleting SPAM Users After X Days in Drupal 8

In Drupal 7 we had the LoginToboggan module, but this is not available for Drupal 8.  I needed to replace the "Delete unvalidated users after" x days feature from LoginToboggan so I wrote some quick code that I want to add it in here.  

In a module we can create a function that will delete our unvalidated [sic] users after a set number of days. 

First, I need to define a timestamp for today (right now). 

Tags