• Tired of the increasing number of spammers on my site. Would like to know how i can remove the Website URL field from the Hueman theme’s comment form

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Follow these steps:
    1. Create a Child Theme. This will prevent your changes from being overwritten when the theme gets updated.

    a. Create a folder called “hueman-child” in the wordpress/wp-content/themes/ folder, i.e. the parent folder of the “hueman” folder.
    b. Create a file called “style.css” in the “hueman-child” folder.
    c. Go to the Appearance -> Themes section of your WordPress Admin Dashboard and activate the “hueman-child” theme.

    2. Disable display of the Website URL field: Edit the “style.css” file in your hueman-child folder by adding the following:

    .comment-form-url {
    display: none;
    }

    3. Disable spam bots which automatically post comments:

    In /wp-comments-post.php (should be in your wordpress folder)

    find :
    ——————————————————
    $comment_author = ( isset($_POST[‘author’]) ) ? trim(strip_tags($_POST[‘author’])) : null;
    $comment_author_email = ( isset($_POST[’email’]) ) ? trim($_POST[’email’]) : null;
    $comment_author_url = ( isset($_POST[‘url’]) ) ? trim($_POST[‘url’]) : null;

    add after :
    —————————————–
    if (!empty($comment_author_url))
    wp_die( __(‘Sorry, no spam here…’) );

    Now, the “Website” field will no longer be displayed for your website and SPAM with the “URL” field will be rejected.

    Do back up the /wp-comments-post.php before and after you make the changes. Before, so that nothing breaks on your site, and after, because a WordPress update may over-write the /wp-comments-post.php file, thus requiring you to re-do the mentioned changes.

    Thread Starter MutebiRoy

    (@mutebiroy)

    Thanks @hkchina. Your idea worked very well on the localhost but failed on the real site.
    It echoed error on every comment even if it didn’t contain a URL

    My tweak was the one below and it seems to be working well so far.

    if( !empty( $comment_author_url ) ){
    $comment_author_url == ”;
    }

    Hope to hear more suggestions.

    Thread Starter MutebiRoy

    (@mutebiroy)

    Hi y’all, seems the bots have bypassed my tweak in the previous post and so it’s not working. Hope you can provide a better fix…

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to Remove Website URL Field from Comment Form’ is closed to new replies.