5

We have a client site that has been getting a lot of spam registrations. We're turning on purgePendingUsersDuration to help deal with some of these automatically, but I was planning to go into the database to delete a bunch in bulk directly (since there are almost 200 of them)

Is it safe to delete them just from craft_users and craft_usergroups_users tables? Are there other places I should watch out for?

8

If you want to delete users (or any other elements in Craft) directly from the database, the place to do that is the elements table. Delete the row(s) from there, and all the elements’ rows in the other tables will go away automatically.

4
  • I want to delete a lot of "pending" users. I can't see where in craft_elements what is what. There isn't a column to differentiate them from "active" users? Oct 21 '14 at 6:18
  • 1
    Not to worry, purgePendingUsersDuration seems to work great! Oct 24 '14 at 8:40
  • Is this still the case for 2020? Table elements or elements_sites. craft_elements does not exist. Mar 16 '20 at 1:33
  • 2
    @JessicaTalzor still valid, yes. You should definitely have an elements table (possibly prefixed with something depending on your tablePrefix setting). Mar 16 '20 at 2:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.