Follow me
To me it looks like this may be your first time here. If you like why not Follow me.
You might also like to find out a bit more about me
How to stop forum link spam on SMF
August 2nd, 2008I have had a few problems with people dropping links in their posts or signatures over at my Affiliate Marketing Forum – Affearners so I decided to check a few of them out.
One really nasty one went to the sort of porn that nobody should be interested in and we also had one that went to a site that tried to install some malware on my computer. So enough is enough, had a chat to a few people to run some ideas around (Thanks to JasonD and Perk in particular) and came up with the following plan: -
All links going off site would be intercepted and run through a jumper page to check the link out first.
Any links that were tagged as approved would then pass on and work as normal.
Any links that hadnt been approved would simply be displayed on a page for people who really wanted to go to them to copy and paste into their browser and leave.
So how to do all this on SMF?
Intercepting the links
SMF uses BBCode to make life easier for people to post links in the forum, this meant that we could utilise their hard work to change all the links and add the following to the front of all links off site -
http://www.----escape_autolink_uri:c6b9723d6f5eae4cea3e6878d207df83----.com/forum/outgoing/go.php?link=www.thelinktobechecked.com
Where the link to be checked could then be analysed against the list of pre-approved links.
To do this I changed many instances of the [URL] replacement in subs.php within the sources folder in SMF. Heres what my finished subs.php looks like now: -
To use this just find and replace all instances of http://www.affearners.com/forum/outgoing/go.php?link= with your own script location
*NB If you mess up your own forum thats your own fault!
So that was making all links off site head off to our checking script.
This script simply checks the links people have posted against an array of approved links and if they are approved redirects back out (302
) but if they arent shows this page for the user to copy and paste the link themselves: -
And the code that runs that is as follows: -
This simply checks against our array (took most of the sites out to make it cleaner to show) and if they match jumps onto the site in question. If not we get the page displayed for unapproved links.
Notice I do some chopping off of the http:// part to check and probably should do some url encoding etc.
Pretty simplistic I know but solves a good deal of the issues. In the future ill DB the approval part of the links and add the ability for anyone logged in as admin to approve a link on page.
If you liked this you might also be interested in making friendly 404’s for SMF or making SMF more SEO friendly.
Next ill show you how to solve the profile spam issues
Related posts:
- Solving forum profile spam
- Simple Translation Script
- Why PR actually matters in link buys
- Reasons why cachechecker didnt show any links
- Building a distributed link network
One Response to “How to stop forum link spam on SMF”
Leave a Reply
About SEOidiot
Hi my name is Paul Madden and I am a UK SEO based in Lancashire, for years I have been cursed by the nickname SEOidiot which started life as a form of abuse from someone but you need to decide for yourself how accurate the term is.
Quotes about me
Ralph Tegtmeier aka Fantomaster
World leader in cloaking and SEO



Interesting and practical tip there, Paul. I’d look into commercializing this as a security plugin for forum owners, if you check around and find there’s the demand for it of course…