Deleting posts by banned users with < 3 posts?

Hi Kirupa,

You can find all banned users with <3 posts using the following Data Explorer query:

SELECT p.user_id, COUNT(p.id) AS qtt_posts
FROM posts p
INNER JOIN users u ON u.id = p.user_id
WHERE suspended_till NOTNULL
GROUP BY user_id
HAVING COUNT(p.id) < 3

To delete the users you can use the API: /admin/users/{id}.json, you can see the documentation here.

4 Likes