Deleting users from the OJS database

Can you advise me if I’m forming the SQL query correctly to delete users from my database?

DELETE FROM users
WHERE id IN (
  SELECT user_id
  FROM comments
  WHERE content LIKE '%casino%'
);

Also, does anyone know how to prevent new spam users from simply registering? I understand how this can be done when they use direct words like “casino” in their spam, but not every link that is spam contains these words.

1 Like