Skip to content

Instantly share code, notes, and snippets.

@mohamadaliakbari
Last active December 9, 2021 08:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mohamadaliakbari/5c37f0214eb40a22d53e14c16733cfa8 to your computer and use it in GitHub Desktop.
Save mohamadaliakbari/5c37f0214eb40a22d53e14c16733cfa8 to your computer and use it in GitHub Desktop.
Find, Block and Delete spammers in wordpress

Find spammer IPs (IP with more than 1 unapproved comment)

select comment_author_IP from wp_comments where comment_approved = '0' group by comment_author_IP, comment_approved having count(*) > 1;

Convert to simple ip list using text-editor and REGX

Bulk check ip locations using https://app.ipapi.co/bulk/

Convert to propper format and insert into /etc/nginx/conf.d/blacklist.conf

deny x.x.x.x;
deny x.x.x.x;
allow all;

Delete from MYSQL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment