RBA Cash Rate: 4.35% · 1AUD = 0.67 USD · Inflation: 4.1%  
Leading Digital Marketing Experts | 1300 235 433 | Aggregation Enquires Welcome | Book Appointment
Example Interest Rates: Home Loan Variable: 5.20% (5.24%*) • Home Loan Fixed: 5.48% (6.24%*) • Fixed: 5.48% (6.24%*) • Variable: 5.20% (5.24%*) • Investment IO: 5.78% (6.81%*) • Investment PI: 5.49% (6.32%*)

How Spammers Automate Spam Comments to WordPress

I hate spammers. More than you. However, in order to understand them, one must learn their trade. The following code is about as basic as it gets when it comes to submitting spam comments to WordPress... but it's interesting nonetheless (and has countless legitimate application). Don't worry, I'm not sharing anything our spamming friends aren't already aware of.

Using the principle of submitting a form with CURL, you could very easily and quickly integrate a form into various types of feeds (including RSS) or use it to replicate comments on individual blogs. Used with a cron you could artificially (and remotely) create responses to threads that introduce new elements to a discussion or, integrated with other types of CMS systems, inject news and relevant third party links into a thread.

The format of the WordPress post comment box is consistent from one blog to the next making it easy for spammers to set up automated systems to pollute the blogosphere. You'll be surprised how many spam comments actually get published. A friend of mine used to reply to them not knowing he was wasting his time.

The Code

1
<?php 
2
/*
3
 How Spammers Automate Spam Comments to WordPress
4
 http://www.beliefmedia.com/code/wp-snippets/automating-spam-comments
5
*/
6
 
7
$postfields = array();
8
$postfields["action"] = 'submit';
9
$postfields["author"] = 'Marty';
10
$postfields["email"] = 'spam@spam.com';
11
$postfields["url"] = 'http://www.SpamBlows.com';
12
$postfields["comment"] = 'This comment spam. Happy happy good luck number 7.';
13
$postfields["comment_post_ID"] = '1';
14
$postfields["_wp_unfiltered_html_comment_disabled"] = '84248387b9';
15
$useragent = 'Mozilla/5.0';
16
$referer = $url;
17
 
18
$url = 'http://www.SomeDomain.com/wp-comments-post.php';
19
$site = 'http://www.SomeDomain.com/hello-world/';
20
 
21
$ch = curl_init(); // initialize curl handle
22
curl_setopt($ch,CURLOPT_REFERER,$site);
23
curl_setopt($ch, CURLOPT_URL,$url); // set url to post to
24
curl_setopt($ch, CURLOPT_POST, 1); // set POST method
25
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields); // add POST fields
26
curl_exec($ch); // run the whole process
27
28
echo "Done";

The Result

If a spammer were to use something like this they would almost certainly have millions of posts indexed in a database that they'd loop through at a set interval (with the clever ones categorizing comments by topic so they can submit a 'most relevant' response). Obviously, they'd randomize their email, IP, referrer and other details.

How Spammers Automate Spam Comments to WordPress

If you were to check the referring page you could quite possibly eliminate spam submitted via this method.

Download our 650-page guide on Finance Marketing. We'll show you exactly how we generate Billions in volume for our clients.

  E. Australia Standard Time [ UTC+10, Default ] [ CHECK TO CHANGE ]

  Want to have a chat?
 

Like this article?

Share on Facebook
Share on Twitter
Share on Linkdin
Share on Pinterest

Leave a comment