• Before I show this small hack (NOT A PLUGIN OR ANYTHING, JUST NEED TO ADD A CODE TO YOUR COMMENTS PAGE), I got to say something. I made this small idea up to stop spam. You can modify this small snippet. I think It should work. What this does is:

    When a user hits the button to add their comment, a Javascript alert box will popup that will say:

    “Click ok to add your comment. This is to stop spambots from flooding”

    The user must click ok for the comment to be published. I doubt that spam bots can do that. The thing spam bots do is: They fill in fake info in the name,email, website box and then, they search for the submit button or link and submit it. I doubt they will escape with this code.

    Ok. Here is how it works:

    1) (WP 1.5 +) Go to Presentation>Theme Editor> and select the theme you are using.
    2) Click on “Comments Template“.
    3) Some where on the bottom, Find a *SIMILAR* code to this one (This one is from the theme “arzel_xt2”):

    <textarea name="comment" id="comment" cols="55%" rows="7" tabindex="4"></textarea>
    <b><font color="red">Warning</font></b>: <b><i>Spammers will be IP banned!</i></b>
    <input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" />

    Replace that with:
    <textarea name="comment" id="comment" cols="55%" rows="7" tabindex="4"></textarea>
    <b><font color="red">Warning</font></b>: <b><i>Spammers will be IP banned!</i></b>
    <input name="submit" type="submit" id="submit" tabindex="5" <strong>onclick="return confirm("Click ok to add your comment. This is to stop spambots from flooding comments.")"</strong> value="Submit Comment" />

    There ya go! Your done! Now, when you submit a comment, It will look like this: https://img116.exs.cx/img116/7886/scre2bk.gif

    THIS HASN’T BEEN TESTED ON WP 1.2.2!: If this is for WP 1.2, You will have to edit wp-comments-reply.php and modify:
    <code><label for="comment">Your Comment</label>

    <textarea name="comment" id="comment" cols="70" rows="4" tabindex="4"></textarea></code>

    to

    <label for="comment">Your Comment</label>

    <textarea name="comment" id="comment" cols="70" rows="4" tabindex="4"></textarea>

    <input name="submit" type="submit" tabindex="5" onclick="return confirm("Click ok to add your comment. This is to stop spambots from flooding comments.")" value="Say it!" />

    If this small hack isn’t working, Make sure you have a ‘ instead of ” in the onclick code. Also, if you get some kind of error, Please post it and I’ll see what I can do.

    Also, I like this is because If people notice they made a typo or they want to edit their comment but they already submitted it, They don’t got to worry because all they got to do is click on “Cancel” and edit it. Once they click on Ok, comment is published.

    If someone gets spammed alot by bots, See If this works and post it here!

    XeroCool

Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Hack: Confirm to add your comment.’ is closed to new replies.