{"id":1498,"date":"2010-09-06T17:18:01","date_gmt":"2010-09-06T15:18:01","guid":{"rendered":"http:\/\/planetozh.com\/blog\/?p=1498"},"modified":"2010-09-10T12:58:16","modified_gmt":"2010-09-10T10:58:16","slug":"spam-magnet-blog-posts","status":"publish","type":"post","link":"https:\/\/planetozh.com\/blog\/2010\/09\/spam-magnet-blog-posts\/","title":{"rendered":"Spam Magnet Blog Posts"},"content":{"rendered":"<p>Lately, every time I manually flagged a comment as spam, I started to have the impression that they all were posted on the same post, namely an old announcement for my plugin &quot;Absolute Comments&quot;.<\/p>\n<p>An SQL query later, my impression was confirmed: this blog post *is* a spam magnet:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/planetozh.com\/blog\/wp-content\/uploads\/2010\/09\/spam-magnet.png\" alt=\"\" title=\"spam-magnet\" width=\"521\" height=\"438\" class=\"aligncenter size-full wp-image-1501\" srcset=\"https:\/\/planetozh.com\/blog\/wp-content\/uploads\/2010\/09\/spam-magnet.png 521w, https:\/\/planetozh.com\/blog\/wp-content\/uploads\/2010\/09\/spam-magnet-300x252.png 300w\" sizes=\"auto, (max-width: 521px) 100vw, 521px\" \/><\/p>\n<p>I suspect that some particular keywords in page titles act like pheromones to spammers. These keywords probably include &quot;comments&quot;, &quot;guestbook&quot;, &quot;feedback&quot; and anything that will make them think there&#39;s a form they can spam.<\/p>\n<p>The SQL query I used to list blog posts sorted by the number of spam they get is:<\/p>\n<div id=\"ig-sh-1\" class=\"syntax_hilite\">\n\n\t\t<div class=\"toolbar\">\n\n\t\t<div class=\"view-different-container\">\n\t\t\t\t\t\t<a href=\"#\" class=\"view-different\">&lt; View <span>plain text<\/span> &gt;<\/a>\n\t\t\t\t\t<\/div>\n\n\t\t<div class=\"language-name\">sql<\/div>\n\n\t\t\n\t\t<br clear=\"both\">\n\n\t<\/div>\n\t\n\t<div class=\"code\">\n\t\t<ol class=\"sql\" style=\"font-family:monospace\"><li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #993333;font-weight: bold\">SELECT<\/span> <span style=\"color: #993333;font-weight: bold\">COUNT<\/span><span style=\"color: #66cc66\">&#040;<\/span>wp_posts<span style=\"color: #66cc66\">.<\/span>ID<span style=\"color: #66cc66\">&#041;<\/span> <span style=\"color: #993333;font-weight: bold\">as<\/span> spam_count<span style=\"color: #66cc66\">,<\/span> wp_posts<span style=\"color: #66cc66\">.<\/span>ID<span style=\"color: #66cc66\">,<\/span> wp_posts<span style=\"color: #66cc66\">.<\/span>post_title<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #993333;font-weight: bold\">FROM<\/span> wp_posts<span style=\"color: #66cc66\">,<\/span> wp_comments<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #993333;font-weight: bold\">WHERE<\/span> wp_comments<span style=\"color: #66cc66\">.<\/span>comment_approved <span style=\"color: #66cc66\">=<\/span> <span style=\"color: #ff0000\">'spam'<\/span> <span style=\"color: #993333;font-weight: bold\">AND<\/span> wp_comments<span style=\"color: #66cc66\">.<\/span>comment_post_ID<span style=\"color: #66cc66\">=<\/span>wp_posts<span style=\"color: #66cc66\">.<\/span>ID<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #993333;font-weight: bold\">GROUP<\/span> <span style=\"color: #993333;font-weight: bold\">BY<\/span> wp_posts<span style=\"color: #66cc66\">.<\/span>ID<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #993333;font-weight: bold\">ORDER<\/span> <span style=\"color: #993333;font-weight: bold\">BY<\/span> spam_count <span style=\"color: #993333;font-weight: bold\">DESC<\/span><\/div><\/li>\n<\/ol>\t<\/div>\n\n<\/div>\n\n<p>If you want to play with it, I made a quick standalone script that will run the query and output a pretty interactive pie chart. Download <a href=\"http:\/\/planetozh.com\/blog\/wp-content\/uploads\/2010\/09\/spam-magnet.txt\">spam-magnet.txt<\/a>, rename as <tt>.php<\/tt> and put it in your blog root (where <tt>wp-load.php<\/tt> is). Live demo: <a href=\"http:\/\/planetozh.com\/blog\/spam-magnets.php\">spam-magnets.php<\/a>.<\/p>\n<p><strong>Edit<\/strong>: per request, I&#39;ve made this a <a href=\"http:\/\/wordpress.org\/extend\/plugins\/ozh-spam-magnet-checker\/\">plugin too<\/a>.<\/p>\n<p>If you run it and notice a pattern on your blogs too, share your analysis! I&#39;ve always enjoyed useless fun stats :)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Lately, every time I manually flagged a comment as spam, I started to have the impression that they all were posted on the same post, namely an old announcement for my plugin &quot;Absolute Comments&quot;. An SQL query later, my impression was confirmed: this blog post *is* a spam magnet: I suspect that some particular keywords [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[2,324,27,74,245],"class_list":["post-1498","post","type-post","status-publish","format-standard","hentry","category-published","tag-code","tag-comments","tag-spam","tag-stats","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/posts\/1498","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/comments?post=1498"}],"version-history":[{"count":0,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/posts\/1498\/revisions"}],"wp:attachment":[{"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/media?parent=1498"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/categories?post=1498"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/tags?post=1498"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}