Community Forums › Forums › Archived Forums › General Discussion › Remove Email Field from Comments
Tagged: comment fields
- This topic has 6 replies, 2 voices, and was last updated 12 years ago by
David Chu.
-
AuthorPosts
-
June 18, 2014 at 8:31 am #110355June 18, 2014 at 10:10 am #110370
David Chu
ParticipantHi Lyndsay,
There is a method for doing that.But before I mention that, I would recommend against that, I would strongly caution your client against that. While it probably sounds great to make it easy to comment, in practice this means that she'll probably get a firehosing of spam if she's not requiring name or email address. In fact, even with those, she'll have to deal with spam. For that I use Akismet plugin supplemented with NoSpamNX plugin. So you've been duly warned. ๐
She might say, "that's the way it works in Facebook", but everybody there is logged in and duly identified. ๐ You can actually set WP comments to work that way, too, by requiring people to open a user account and log in.
If she doesn't mind getting creamed... here's how to do it: with name and email requirement unticked, this line should work to take out the email, which is a default. This would go in your functions.php:
add_filter('comment_form_field_email', '__return_false');Best, Dave
Dave Chu ยท Custom WordPress Developer – likes collaborating with Designers
June 26, 2014 at 1:52 am #111595lyndsaymoon
MemberHi David,
Thanks so much for your help with this it worked a treat! ๐
I have cautioned her, but it's going to be an anonymous form for replies to go live straight away. I have added captcha to try and help.
June 26, 2014 at 9:01 am #111629lyndsaymoon
MemberMy Customer has now come back and said…
"Could you put the e mail box back in but put (optional)"
Is it an option, to have an optional email address field?
Thanks.
June 26, 2014 at 10:06 am #111640David Chu
ParticipantHa! Clients.....
That's getting a little gnarly, and frankly, begins to get beyond the scope of my free help. ๐I think you could get almost all that by keeping the requirement for email and name unticked. Then the whole thing becomes optional. And then if you want to remove the URL, you could do the following, very similar to above.
add_filter('comment_form_field_url', '__return_false');It doesn't give you the "optional" caption, but the fields should indeed be optional.
Then you can tell her about moderation vs. no moderation. Most people don't want an additional "job" of moderation.
Good luck, Dave
Dave Chu ยท Custom WordPress Developer – likes collaborating with Designers
June 26, 2014 at 10:21 am #111644lyndsaymoon
MemberHi Dave,
I totally get where your coming from!!
Thanks so much for all your help, I really appreciate it ๐
June 26, 2014 at 4:53 pm #111676David Chu
ParticipantLyndsay,
I'm glad it helped, and nice talking with you again.See you later,
Dave
Dave Chu ยท Custom WordPress Developer – likes collaborating with Designers
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.