WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Getting rid of website and email requirements for commenting (11 posts)

  1. Marius-
    Member
    Posted 5 years ago #

    Is this possible?
    I don't see the point in requiring users to input their supposed websites and emails when they comment, so I would like to remove these fields from the comment forms.

    I only want Name, and Comment, nothing else. This is to make it as easy and logic as possible for users to comment on my website. I tried looking around in the settings of the admin-tools, but with no luck.

  2. @mercime
    Volunteer Moderator
    Posted 5 years ago #

    Well, I can see that you're fearless about spam comments :-)
    In any case, you would have to delete the website and email requirements from your comments in your theme's omments.php
    Make a backup of your comments.php and look for something like the following and delete it:

    <p><label for="email">Mail (will not be published) <?php if ($req) echo "(required)"; ?></label>
    <input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?> />
    </p>
    <p><label for="url">Website</label>
    <input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
    </p>
  3. Marius-
    Member
    Posted 5 years ago #

    Yeah I don't mind real users spamming. But I wonder, will Akismet still be able to filter out spambots?

  4. Mark / t31os
    Moderator
    Posted 5 years ago #

    Easier approach would be to hide the fields and autocomplete them...

    WP will likely expect these fields, so just removing them may not have the desired effect.

    I could be wrong though..

  5. Marius-
    Member
    Posted 5 years ago #

    How do you "hide" the fields then?

  6. esmi
    Forum Moderator
    Posted 5 years ago #

    Website could be removed. It's not a required field, IIRC.

    Fields and their labels can be hidden from (almost) everything by adding a class to the enclosing <p> or <div and then styling that class using display:none;.

  7. Mark / t31os
    Moderator
    Posted 5 years ago #

    Or..
    <input type="hidden">
    .. if i'm not mistaken..

  8. esmi
    Forum Moderator
    Posted 5 years ago #

    On the markup that mercime suggested, that would leave the form label in clear view.

  9. Marius-
    Member
    Posted 5 years ago #

    yeah esmi, could you give me the exact code I need so I can just paste it in?

    It's http://www.michaeljackson.no

  10. @mercime
    Volunteer Moderator
    Posted 5 years ago #

    How could it leave the label in clear view when I suggested to DELETE email and website markups?

  11. buddha trance
    Member
    Posted 5 years ago #

    I tested locally what mercime suggested and it works.

    In admin dashboard --> Settings --> Discussions, you have to uncheck "Comment author must fill name and email", otherwise it will require the email input.

Topic Closed

This topic has been closed to new replies.

About this Topic