WordPress.org

Ready to get started?Download WordPress

Forums

Comment Spam - disable comments on older posts (16 posts)

  1. steelsun
    Member
    Posted 9 years ago #

    I am currently getting comment spam. The spammer (one gambling site - a stupid one at that) is spamming each post. I'm guessing it's a script that's doing it, since they started by having a comment to post 1, then 2, then 3, etc. Some of those posts had been deleted awhile ago so they could not be viewed to comment on.
    Any way to make it so posts over x days old can't be commented on (or are automatically put into moderation). For example, if a post is over 14 days old, it certainly is not current and on the front page, so all comments should be moderated.
    Any easy hacks/plugins/fixes for this?

  2. TechGnome
    Moderator
    Posted 9 years ago #

    Check out the wiki ( http://wiki.wordpress.org ) ... there's a plugin called AutoComment Closer (or AutoClose Comments.... something like that) that will work for you. I use it along with WPBlacklist, and don't have a problem (99.99% spam free).
    TG

  3. steelsun
    Member
    Posted 9 years ago #

    Thanks, I'll try that.

  4. steelsun
    Member
    Posted 9 years ago #

    Here's two I found:
    http://weblogtoolscollection.com/index.php?p=48&more=1&c=1
    and
    http://wiki.wordpress.org/Auto%20shutoff%20comments
    The first is in plain enough english I might try it out, the second is not non-coder friendly as I have no idea how to implement it.

  5. Anonymous
    Unregistered
    Posted 9 years ago #

    It seems that the problem is because the WP doesn't check the IP address from which the comment is posted from. I have disabled comments entirely. Even though no-one can view the posts, i'm still getting someone adding comments (to non-existant entries at that). I have just decied to remove the wp-comments-post and wp-comments-reply files entirely.

  6. TechGnome
    Moderator
    Posted 9 years ago #

    Go with the second one.... trust me....
    Copy the text that's in the SECOND example. The one with all the add_Actions in it.
    Copy it from the opening <?php through the end ?>
    Paste it into an empty text file. Make sure there are NO SPACES or carriage returns after the closing ?>..... delete them if they are there. Save the file as autoclose.php. Upload it to your website in the following location: /wp-content/plugins.
    Then go into your Admin area and select "Plugins" from the menu. Find the AutoClose plugin, and activate it.
    The plugin will now close out older posts anytime you perform any of the actions listed in the add_filter section. Edit a post, publish a post, and other actions like that.
    I've been using it for some time with mucho success.
    TG

  7. steelsun
    Member
    Posted 9 years ago #

    Thanks TechGnome. I'll do that right now.
    I tried the first one initially but it had no effect whatsoever.

  8. steelsun
    Member
    Posted 9 years ago #

    It seems to be working. I was averaging one comment spam every 20 minutes from the same turd, but none now in the last hour since I put up that plug-in.

  9. TechGnome
    Moderator
    Posted 9 years ago #

    Yeah, the catch is that you have to do something in WP to get the plugin to trigger. Typicvally if you post everyday or at least at some kind of regular interval, it works very well.
    TG

  10. arthurkang
    Member
    Posted 9 years ago #

    I was getting this gambling site content spam as well. As the previous plugins probably work good, I think it is a problem to allow comments to be created on posts that no longer exist.
    Adding the simple check:
    if ( !($wpdb->get_var("SELECT ID FROM $tableposts WHERE ID = '$comment_post_ID'")) )
    die( __('Error: that post is no longer available.') );

    Into the wp-comments-post.php file somewhere in there where it checks for other stuff (around line 35) will check and make sure the post exists before adding the comment.

  11. schleifnet
    Member
    Posted 9 years ago #

    apparently this issue is solved in 1.2.2 see line 44 in comments-post.php

    very cool i say

  12. Johnnie
    Member
    Posted 9 years ago #

    Ok I don't get the autoclose plugin... I've activated, but no what do I do? I'm not very educated in .php so am I to edit something in the plugin? A line of code or something to get old posts to close off comments?

  13. Mark (podz)
    Support Maven
    Posted 9 years ago #

    Johnnie - once it's in and activate, just forget about it.
    Everytime the db changes, it does it's job.

    Check it a couple of times if you need to - it's been active on mine since it came out and hasn't done harm, or gone wrong.

  14. Or, if you're still unsure about it and just want to nuke all comments entirely, delete wp-comments-post.php. Otherwise, Podz is right (as always).

  15. Johnnie
    Member
    Posted 9 years ago #

    Thanks Podz & Macmanx!!

  16. sweavo
    Member
    Posted 9 years ago #

    Yeah, the catch is that you have to do something in WP to get the plugin to trigger. Typicvally if you post everyday or at least at some kind of regular interval, it works very well.

    TG

    That's bizarre - why can't the something be posting a comment? Then it's updated when you need it most.

    I've just made an extra page for wp-admin that lets you bulk delete comments based on key words in post_author or post_content. If anyone reading is competent with SQL and wordpress I'd be grateful if you'd have a look at the "despam" download at http://www.sweavo.34sp.com/downloads
    have a play with it and let me know what you think.

    Back up your comments table first! I don't think it's buggy, but the two most likely effects of a bug are:

    1. It doesn't delete any comments, or
    2. it deletes all your comments!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.