• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Implemented Spam phrases could also inspect thread title for matches

Rudy

Well-known member
#1
The ability to scan new messages for spam phrases has been helpful. Spammers nearly always post links in the message body, so using "http" as a filter helps to trap them before the message appears in public. (We send ours to the moderation queue.)

Spammers apparently are also now trying to use the thread title to promote a URL. An option to have the spam phrase filter check the thread title would be a welcome addition.

@wardsweb
 

Mike

XenForo developer
Staff member
#2
I'm not sure if we should call this implemented, but the spam phrases option does include the thread title in the content it checks. It's included in the content we check before the main message body (so it's not distinguished within the content checked).

Because of some of the technical differences with post bodies and titles, there is a way to mostly catch a thread title that is a URL:
Code:
/^https?:\/\/\S+\n/si
We use that rule here. In the post body, the URL would be converted to a URL BB code automatically so it won't match that. (Technically this does catch a profile post starting with a URL, followed by a line break, though that might be a good thing...)
 

Mike

XenForo developer
Staff member
#4
That wouldn't match the regex I posted -- you can adjust it if needed. But beyond that, you wouldn't be checked for spam (because of number of messages and because of group permissions).
 

Mike

XenForo developer
Staff member
#6
It's specifically matching "http://" or "https://" (followed by a line break) at the beginning of what's passed to the spam phrases check. If you want to match www then you could do something like:
Code:
/^www\.\S+\n/si
We haven't felt the need to bring that rule in here -- we do see the spam with a URL in the title and at this point, it has always included the http part. As always though, you really need to tune your anti-spam rules to what is common on your forum (and which avoids false positives for your forum as much as possible).
 

Mike

XenForo developer
Staff member
#8
They each go on their own line in the "spam phrases" option. (You can use the ACP search to be directed to it specifically.)
 

snoopy5

Well-known member
#9
o.k., thanks. What if the spammer puts any kind of word before or after the url within the title? Will the posting be still surpressed?
 

Mike

XenForo developer
Staff member
#10
Not with the examples I've provided. If you have any further questions, it's probably better to post in a separate thread as this is a suggestion over something particular with how the spam phrases system.
 

Rudy

Well-known member
#11
@Mike

Yes, indeed, the regex does work in XF 2.0. Tested it now with a new test account and it is working nicely. For the message body, I have been using simply 'http*' which has been catching links properly--if it is a little too aggressive, no problem, since all flagged posts go to moderation.

Are the thread titles also checked for spam phrases in XF 1.5, or was this added for 2.0?

(Never mind--I have it working in 1.5 now.)

Thanks for checking, and I probably should have posted this in the "troubleshooting area first", no? ;)
 
Last edited: