WordPress Tip: Remove Spam from the Comment Subscription Manager

Published Monday, March 10, 2008 @ 11:34 am • 7 Responses

[ Image: Jonny Quest (Inverted) ] After investigating some unusual 404 errors the other day, I found myself digging through the WordPress Admin trying to locate the “Subscribe to Comments” options panel. As it turns out, administrative options for the Subscribe to Comments plugin are split into two different areas. First, the S2C plugin provides configuration options under “Options > Subscribe to Comments”, which enables users to tweak everything from subscription messages to custom CSS styles. New to me was the other half of the S2C administration area: the Subscription Manager! Carefully hidden under “Manage > Subscriptions”, the Subscription Manager provides several useful ways to filter your email subscribers:

  • via “Top Subscriber List”
  • via “Top Subscribed Posts”
  • via searching entries by email address
  • via listing everyone who has subscribed

Fascinated by my discovery, I began playing around with the various filtering options and quickly noticed a rather large number of email subscriptions for “jonny123” and his many different @gmail.com accounts:

[ Screenshot: List of Jonny Subscriptions ]

As much I would like to think that these were all unique, authentic subscribers, this was obviously not the case. Sadly, the President of the Perishable Press fan club is an army of jonny clones. In fact, I quickly learned that roughly half of all comment subscriptions were for the incredibly prolific jonny family. Apparently, in their relentless, mindless efforts to make everyone’s online lives utterly miserable, comment spammers employ automated scripts that populate comment forms by filling out or responding to every available input field 1. Thus, when such spam scripts hit your comment form, many will automatically select the checkbox to “subscribe to follow-up comments via email.” In the process of doing this, they are populating your Subscribe to Comments email list with their randomly generated email information, effectively spamming your S2C Subscription Manager without even trying to do so.

Dealing with Jonny

With hundreds of these “jonny” entries to deal with, I could have really used a built-in “mass editing” feature, but alas, none is provided. In fact, to remove “jonny” spam from the comment subscription list, you have to manually select each subscriber, wait for the page to load, tick the checkbox next to any/all posts to which they have subscribed, and click “Remove Selected Subscription(s)”. Then return to the list and wash, rinse, repeat. This method works great for removing a few subscribers every now and then, but to eliminate vast cesspools of jonny waste, we need must invoke the magical powers of SQL!

Using phpMyAdmin or equivalent, execute the following customized query:

SELECT `comment_post_ID` , `comment_ID` , `comment_author_email` , `comment_subscribe`
FROM `wp_comments` WHERE `comment_subscribe` = 'Y' 
LIMIT 0 , 100

This will return a nice table listing the comment ID, post ID, and email address for every comment subscriber. As written, the query shows 100 entries per page, but this is easily adjusted in the third line (e.g., edit 100 to desired value). This is the exact same list of subscribers as displayed in the plugin’s Subscription Manager. The benefit of using a direct database query for removing subscriber spam is the ease with which unwanted entries may be identified and removed. Simply scan the list for spam entries, tick the associated checkbox, and click the “Delete” button.

Take Home..

My advice? If you are using the Subscribe to Comments plugin (or something similar), login and examine your subscriber list. You may be surprised to find a “jonny-clone fan-club” of your very own! ;)

References

  • 1 This fact has led to the implementation of several effective “honey pot” methods of fighting automated comment spam.

Dialogue

7 Responses Jump to comment form

1Louis

March 10, 2008 at 12:15 pm

The “Dealing with Jonny” headline is so great :’D

It’s interesting to point out that the mailing plugin is vulnerable to spam. Isn’t it protected by the askimet (and other antispams) engine ?

I mean, if the comment is detected as spam, does it still write the mail adress in the mailing plugin database ?

Note: your “References” footnotes need anchors. From word to explanation, and vice versa.

2Perishable

March 10, 2008 at 2:41 pm

Thanks Louis, I really had a blast writing this article — probably more than I should have..

You raise a good question, one to which I do not know the answer. I do know that both Akismet and Bad Behavior were active at the time of investigation (and possibly Spam Karma, but I honestly don’t remember). I suppose it would’t be too difficult to run a few tests, but I just don’t have the extra time!

Also, thanks for the heads up on the References link.. should work fine now.

3Louis

March 11, 2008 at 3:35 am

I would’ve tested it if I had had comments on my blog :p

Concerning the footnotes, your anchors are in place, but I would recommend you the Gruber’s way of doing back anchors, i.e :

XHTML[1]

1. The new black [↩]

Because the ↩ sign speaks for itself.

But I guess that’s not quite important.

4Perishable

March 11, 2008 at 7:31 am

Hmmm.. I like it! “↵” does have a certain “ring” to it!

Thanks :)

5Perishable

March 11, 2008 at 7:33 am

Wait a minute — what is the actual code used to create the shorter version? It looks different than mine..

6Louis

March 11, 2008 at 9:33 am

Footnotes” at daringfireball:

Unicode LEFTWARDS ARROW WITH HOOK, decimal-encoded HTML
entity ↩

7Perishable

March 11, 2008 at 9:59 am

Nice. Thanks ;)

Subscribe to comments on this post


[ Comments are closed for this post. ]

If you have additional information, contact me.

← Previous post • Next post →

« What is My WordPress Feed URL?An Easy Introduction to Web Feeds »

Contact Perishable Press

  • Contact Jeff via form

Search Perishable Press

About Perishable Press

Perishable Press is the virtual playground of Jeff Starr — visionary, founder and lead developer of Monzilla Media, a small web and graphic design company in the lush desert oasis of Moses Lake, Washington. Perishable Press features articles and tutorials on many aspects of digital design..

Read more..

Perishable on Twitter

Twitter's new "xx new tweets" feature is a little too close to an annoying nag for my tastes - always makes me feel like i am running behind

Perishable on Tumblr

Insane October

Sun, 01 Nov 2009

By far the most insane month of 2009, October included the following activities:

1st week: Trip to the East Coast, beginning with some business in Connecticut.

2nd week: East Coast trip continues with much pleasure in downtown Manhattan.

3rd week: Photo and art excursions with good friend visiting from Portland, OR.

4th week: Marathon book-editing and fine-tuning for Digging into WordPress.

Now that November is here, things remain busy, but I am hoping to get a chance to restore some balance and regain my equilibrium. Of course, the holidays are right around the corner..

Import Feeds to Facebook

Mon, 07 Sep 2009

Seems like a lot of misinformation and confusion out there on how to import and display your feeds on Facebook. Here is what worked for me:

1. In the lower left-hand corner of your Facebook account, click on “Applications” > “Notes”.

2. In the upper mid-right column, click on “Import a blog” in the “Notes Settings” panel.

3. In the “Import an External Blog” panel, enter your feed URL and check the little box.

4. Click the “Start importing” button and then click on “Confirm Import” on the preview page.

That’s all there is to it. Don’t forget to edit your “Notes Privacy” settings to ensure that people can see and comment on your imported feed items.

Once you successfully import your feed(s), they will appear by clicking on the “Notes” button in the left sidebar of your Home page. Also, your timeline or “Wall” will also display the most recent post from each of your feeds as they are published and pulled into Facebook. This makes it easy for your “Friends” to see what you have been up to elsewhere on the Web.

help me in plain english

Mon, 31 Aug 2009

This has got to be the most ironic comment I have ever read:

“hi i dun a stupid noooby mistake and dint think about encrytion i just put a pass in the change pass box and now when i attempt to see my main.php or index.php its sayin password no and error how can i reset back to having no password or were can i edit the bit so that a pass is automattically seen or if not posable how can i make it so i can put in the pass i made at some point so i can login this way? the 3rd is most prefered as this will help me with other projects i am planning as i am a php noob :s plz sum1 hu is clever help me in plain english”

Thanks, “jay” — you made my week with that one.

Redirection After Registration

Tue, 04 Aug 2009

After searching high and low for an unobtrusive method of redirecting users to a custom URL after registering at a WordPress-powered site, I finally resorted to (gasp) hacking the core. I simply could not find a better way of doing it that didn’t require a ton of additional code. I found several ways of redirecting users to various URLs after logging in and out, but absolutely nothing seems to exist on redirecting users to, say, the home page, or better yet, back to the current page after registering as a subscriber (or whatever role the Admin has set for new registrations). Indeed, the only way to direct a user to some page other than the default WordPress “Registration complete. Please check your e-mail.” screen (which looks just like the WP Login page, btw) is to hack the wp-login.php file.

Thus, for the sake of remembering this technique, helping others, and/or “inspiring” someone to find a solution, here’s how to hack WordPress to change the page that users are directed to after they register (via submission of a username and email address). First, open the wp-login.php file and find the line that says, “wp_redirect('wp-login.php?checkemail=registered');”. That’s the key right there. To change the location, replace the part that says, “wp-login.php?checkemail=registered” with the URL to which you would like to direct the newly registered users. You may use full URLs or even relative paths to a specific file. That’s all there is to it. It’s still hacking the core, but not by much ;)

Remember, if you’re going to hack the core, make a note of the change(s) and refer to it before/after each subsequent upgrade.

A 500KB wp_options Table is Too Much

Thu, 09 Jul 2009

After my server crashed, I found myself restoring my site’s WordPress database. While there, I decided to dig around a bit and make sure everything was up to snuff. While looking through the wp_options table, I was surprised to discover that WordPress seems to cache around 400KB of “Planet WordPress” dashboard feeds (among other things). That’s a little extreme if you ask me, so I decided to clean things up and reduce my overall database size by around half a megabyte. Here’s how I did it using my archaic 2.3 version of WordPress and phpMyAdmin.

Step One: Take Some Notes

Before doing anything, copy and paste a few text snippets from your dashboard feeds. This will enable you to easily locate the oversize options fields for removal in Step Three. Note: permalinks from the various feed entries make for good search candidates.

Step Two: Kill the Feed

Place this in your theme’s functions.php file (props to Michael Shadle for the code):

function remove_dashboard_feeds() {
remove_action(‘admin_head’, ‘index_js’);
}
add_action(‘admin_head’, ‘remove_dashboard_feeds’, 1);

Step Three: Clean up Your wp_options Table

Once that is done, you may clean up your database by doing a quick search for some of the text snippets (permalinks work great) that you copied from the dashboard feeds in Step One. The field(s) that you find should be named something like “rss_123abc…”, where the “123abc…” is some long, apparently random alphanumeric string. Once you have disabled the feed via functions.php, feel free to reduce the size of your database by deleting the field(s) used to store data for the dashboard feed.

Doing this saved me an extra ~400KB of space, which is much-needed as the size of my Perishable Press database continues to grow.

Read more on Tumblr..

Subscribe to Comments Recent Dialogue

  • david: the IfModule mod_rewrite.c code didn't paste correctly, there is an ifmodule and /ifmodule wrapped around the 2 sections...
  • Peekay: Xoops users who allow user registration are going to need to comment out: # RedirectMatch 403 register\. from the 'Specific ...
  • Regan Frank: Hi, Just wanted to say thanks for this hack. I really needed something to work for me and your code was a god send. Thanks...
  • Sarah: You guys have some decent SEO. I pulled you right up on a yahoo search. Nice site too!...
  • Peekay: My problem is similar to the one highlighted by Rick Beckman. Our spammer is submitting a GET request for the contact form on my site...
  • kimuffessymet: im too complex to discarded to the gym, anyone advance where i can get a elliptical trainer so i can work at habitation. As this is t...
  • Tom: Just one thing - Windows Mobile 6.5. This seems to be barfing on all my otherwise good work. :(...
  • ILT: Hi there, Fantastic feature! However I need to show the full text description, not just the excerpt. Can I achieve this using th...
  • Nicolas: Thanks for the tip. I had some corners that would ideally have been round, but I had a dynamic change-color script that would have...
  • Nik: you are amazing. thank you for writing this....

Read more recent comments..

Attention: Do NOT follow this link!