My site is under repeated attacks by spammers who create accounts manually with nonsense email addresses and "fake" IP addresses (no way to block them).
I came up with the idea of blocking node creation with the Rules module, using data comparison, but it does not work. Here is a summary of the rule I have:
Event : Before saving content
Conditions: text comparison : Parameter: Text: [node:body:value], Matching text: lexapro, etc. [how to make the list of words/expression? One per line?]
Actions : page redirect
Update: starting from the rule in this answer, I created a rule which will redirect to a page and unpublish the node, but only if the words are both in the title and in the body. I've tried to put an OR in the rule, but it didn't work.
{ "rules_simple_antispam" :
{
"LABEL" : "Simple antispam",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [ "rules" ],
"ON" : { "node_presave" : [] },
"IF" : [
{ "text_matches" : { "text" : [ "node:title" ], "match" : "lexapro" } },
{ "text_matches" : { "text" : [ "node:body:value" ], "match" : "lexapro" } }
],
"DO" : [
{ "redirect" : { "url" : "death-spam" } },
{ "node_unpublish" : { "node" : [ "node" ] } }
]
}
}
What do I need to change in my rule to make it work?
PS: I'm not a coder.