• I ran a couple of searches before posting this (maybe using the wrong keywords) but anyhoo I ran across a simple little javascript on the web that will only submit a form (i.e. wp comments) when the user enters a value that you create. It’s not as sophisticated as a random image generated one but it seems to be doing the trick. Check it out here If I’m late on this sorry just trying to help out.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter mtanner

    (@mtanner)

    Oh PS if you implement this into your wordpress site SOMEONE please post instructions for other members.

    Moderator James Huff

    (@macmanx)

    See this one: https://www.gudlyf.com/index.php?p=376
    “This version now includes the ability to generate phonetic-English text if you dona€?t want to (or cana€?t) create an image.”

    I would like to propose a slightly different fix that is purely client side and much simpler.
    Here is my fix for this particular problem. I change the link using javascript. When the index.php page loads
    in a _real_ browser, the link on the post page will change. The name of the real link should be unique. Here
    I use an example which ideally everyone should change. Unless the spammer actually parse for this hac, they will
    go to my “enable javascript please” page.
    Since making this change I have had no spam, and I believe that this is a highly effective manner of using Javascript.
    You must change the file wp-comments-post.php to a different name. Here I use wp-comments-nospamplease-post.php.
    Then create a new file for the bogus post page. I created a file called wp-enable-javascript.php and
    it instructs people to enable JS on their browsers.
    Below are the file names and the changes I made to them, not including the change I just mentioned above.
    wp-comments.php:
    Change the post attribute to point to your bogus page.
    Before:
    —————-
    <form action="<?php echo get_settings('siteurl'); ?>/wp-comments-nospamplease-post.php" method="post" id="commentform">
    After:
    —————-
    <form action="<?php echo get_settings('siteurl'); ?>/wp-enable-javascript.php" method="post" id="commentform">
    index.php:
    Add the following Javascript code to the header
    ————————————————-
    <head profile="https://gmpg.org/xfn/1">
    <title><?php bloginfo('name'); ?><?php wp_title(); ?></title>
    <SCRIPT language="JavaScript">
    <!--
    function changePostLink() {
    var action = action="<?php echo get_settings('siteurl'); ?>/wp-comments-nospamplease-post.php";
    var node = document.getElementById("commentform");
    if ( node == null)
    {
    return;
    }
    node.setAttribute("action", action);
    }
    //-->
    </SCRIPT>

    And change the body tag to include the onLoad attribute:
    ——————————————————–
    Before:
    ——–
    <body>
    After:
    ——
    <body onload="changePostLink(); return true;">

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Javascript for Spam Bot Control’ is closed to new replies.