Hello everyone,
One of the OJS instances I manage is overwhelmed with fake users and spam. We are taking the necessary security measures to address this issue.
In the meantime, we have decided to delete all users who are only “readers.” Do you have a query to bulk delete this type of user without breaking the referential integrity of the database?
The OJS version is 3.2.1.2, and the database is PostgreSQL
Hi @Alfredo_Cosco ,
They may not be Postgres or your version-specific, but there are a few posts on this that might be helpful:
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.
Hi @geirrosset ,
There’s a tools/mergeUsers.php command-line tool that you can use for batch merging. You can get e.g. a list of usernames or user IDs from the database, then specify them on the command line to get rid of the accounts. From the tool’s usage:
Use this tool to merge two or more user accounts.
Usage: tools/mergeUsers.php targetUsername mergeUsername1 [mergeUsername2] [...]
targetUsername: The target username for assets to be transferred to.
mergeUsername1: The username for the ac…
-Roger
PKP Team
1 Like
Hi all,
thanks for the help, sadly I don’t have traces in the comments (or whatelse) to detect fake accounts.
What if I merge all the users that are only Reader?
How to exctract from the db only those users?
Thanks
Alfredo Cosco