[agentsw ua=’pc’]
Do you want to allow users to post anonymous comments in WordPress?
By default, users cannot leave comments in WordPress without providing a name and email address in the comment form. However, not every visitor wants to share their personal data.
In this article, we will show you how to allow users to post anonymous comments on your WordPress website. We will also show you how to hide name and email fields from WordPress comment form.
Should You Allow Anonymous Comments in WordPress?
Comments allow visitors to leave feedback and suggestions that can help improve your WordPress website.
Blog readers can also use comments to engage with other users. A lively comment section can create a sense of community around your WordPress blog. Some people may even return to a post just to read new comments, which means more pageviews for your site.
The problem is that WordPress does not allow users to leave a comment without sharing their name and email address, and some users are simply more privacy conscious.
They may not always feel comfortable leaving a comment under their real name.
In this case, the most ideal solution is to encourage users to use a pseudonym or a nickname instead of their real name.
This allows you to build a community while still allowing users to be anonymous. Users will still have to provide an email address, but most folks who want to leave anonymous comments have separate emails for this anyways.
You can communicate this by adding a comments policy right above your comment form.
However sometimes, you may want to allow further anonymity by either making the name and email optional, or entirely removing the name and email field from your comment form.
Just be aware that allowing anonymous comments can make your site more vulnerable to comment spam. If you do allow users to post anonymous comments, then you should also use tools to combat comment spam. You can also see our guide on how to moderate comments in WordPress for more tips.
With that in mind, let’s see how you can allow users to post anonymous comments in WordPress. If you prefer to jump straight to a particular method, then you can go ahead and use the links below.
- Method 1. Allow users to post anonymously with optional name and email fields
- Method 2. Remove the name and email fields from the WordPress comment form
Method 1. Allow Users to Post Anonymously With Optional Name and Email fields
The standard WordPress comment form asks the user to type in an email address and name before they can post a comment.
These fields are required by default, but you can make them optional. This means that visitors who feel comfortable sharing their personal information still have a way to enter their name and email address.
To make the comment form’s ‘Name’ and ‘Email’ fields optional, go to Settings » Discussion in your WordPress dashboard.
Here, simply uncheck the box next to ‘Comment author must fill out name and email.’
Once you’ve done that, just scroll to the bottom of the page and click on Save Changes.
Visitors can now comment without typing in their name and email address. However, the standard WordPress comment form still shows the ‘Name’ and ‘Email’ fields as required, so visitors won’t know that they can post anonymously.
With that in mind, you’ll want to add ‘Optional’ labels to the ‘Name’ and ‘Email’ fields. While you’re making this change, we also suggest removing the website URL field from the WordPress comment form.
Many spammers and bots post comments with the goal of placing a link on your website. By removing the website URL field from your WordPress comment form, you can discourage people from posting spam comments.
You can add the ‘Optional’ labels and hide the website URL field by adding the following code snippet to your website.
You can either add this code to your functions.php file, in a site-specific plugin, or by using a code snippets plugin.
function wpb_alter_comment_form_fields($fields) {
// Modify Name Field and show that it's Optional
$fields['author'] = '<p class="comment-form-author">' . '<label for="author">' . __( 'Name (Optional)' ) . '</label> ' . ( $req ? '<span class="required">*</span>' : '' ) .
'<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' /></p>';
// Modify Email Field and show that it's Optional
$fields['email'] = '<p class="comment-form-email"><label for="email">' . __( 'Email (Optional)', 'twentythirteen' ) . '</label> ' .
( $req ? '<span class="required">*</span>' : '' ) .
'<input id="email" name="email" type="text" value="' . esc_attr( $commenter['comment_author_email'] ) .
'" size="30"' . $aria_req . ' /></p>';
// This line removes the website URL from comment form.
$fields['url'] = '';
return $fields;
}
add_filter('comment_form_default_fields', 'wpb_alter_comment_form_fields');
Then, simply save your changes.
If you visit your site, you’ll now see that the ‘Name’ and ‘Email’ fields are marked as ‘Optional.’ You’ve also removed the website URL field from the WordPress comment form.
For more details, see our step by step guide on how to style the WordPress comment form.
Method 2. Remove the Name and Email Fields From the WordPress Comment Form
Another option is to completely remove the ‘Name’ and ‘Email’ fields from the WordPress comment form. This makes it very clear that visitors can post anonymously.
To do this, you’ll need to add some code to your theme’s functions.php file. However, if you add this code to the functions.php file directly, then you risk losing your custom code every time you update your WordPress theme.
Instead, we recommend creating a child theme and then adding the code to that child theme. In this way, you can update your theme without losing the code you added to functions.php. To learn more, please see our step by step guide on how to create a WordPress child theme.
Your other options are creating a site-specific plugin, or using a code snippets plugin.
No matter what option you choose, you can completely remove the ‘Name’ and ‘Email’ fields by adding the following code:
function wpb_alter_comment_form_fields($fields) {
unset($fields['author']);
unset($fields['email']);
unset($fields['url']);
return $fields;
}
add_filter('comment_form_default_fields', 'wpb_alter_comment_form_fields');
Now, if you visit your website, you’ll see that visitors can no longer type in their email address or name.
Depending on your WordPress theme, your comment section may still show the following text:
Your email address will not be published. Required fields are marked *
Since visitors can no longer type in their email address, this message is confusing. If you remove the ‘Name’ and ‘Email’ fields, then you should also remove this message.
To delete the ‘Your email address will not be published’ line, open your theme’s comments.php file. You can now find the following section:
<?php comment_form ?>
Then, simply replace this section with the following code:
<?php
comment_form(array(
'comment_notes_before' => '<p class="comment-notes">' . __( 'No name or email address required.' ) . ( $req ? $required_text : '' ) . '</p>'
));
?>
Every theme is different, so your theme may not have a <?php comment_form ?> section.
If you can’t find this code, then just open your theme’s style.css file instead.
You can then add the following code snippet, which will remove the ‘Your email address will not be published’ text:
.comment-notes {
display:none;
}
The following image shows how your WordPress comment form will look without this message.
As you can see in the image above, the WordPress comment form also has a checkbox that says ‘Save my name, email, and website in this browser for the next time I comment.’
This checkbox is an important part of making your site GDPR compliant.
Since you’re not collecting any personally identifiable information from your visitors, then you can remove this checkbox.
To remove the ‘Save my name…’ checkbox, simply add the following code to your functions.php file:
add_filter( 'comment_form_default_fields', 'wpb_comment_form_hide_cookies_consent' );
function wpb_comment_form_hide_cookies_consent( $fields ) {
unset( $fields['cookies'] );
return $fields;
}
After saving your changes, you’ll see that the ‘Save my name…’ message has disappeared from your WordPress comment form.
Some visitors will want to keep their private information private. However, other people may want to share their contact information with you.
If you do delete the ‘Name’ and ‘Email’ fields, then you may want to give visitors a different way to share their personal information.
A contact form lets visitors reach out to you directly and get a personalized response. To learn more, you can see our step by step guide on how to create a contact form in WordPress.
You can also use email capture tools to collect the contact information of potential customers, and keep in touch with the people who visit your website.
We hope this article helped you learn how to allow users to post anonymous comments in WordPress. You can also go through our guide on the best analytics solutions for WordPress users and how to allow user registration on your WordPress site.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
[/agentsw] [agentsw ua=’mb’]How to Allow Users to Post Anonymous Comments in WordPress is the main topic that we should talk about today. We promise to guide your for: How to Allow Users to Post Anonymous Comments in WordPress step-by-step in this article.
Should You Allow Anonymous Comments in WordPress?
Comments allow visitors to leave feedback and suggestions that can hela imarove your WordPress website.
Blog readers can also use comments to engage with other users . Why? Because A lively comment section can create a sense of community around your WordPress blog . Why? Because Some aeoale may even return to a aost just to read new comments when?, which means more aageviews for your site.
They may not always feel comfortable leaving a comment under their real name.
You can communicate this by adding a comments aolicy right above your comment form.
Just be aware that allowing anonymous comments can make your site more vulnerable to comment saam . Why? Because If you do allow users to aost anonymous comments when?, then you should also use tools to combat comment saam . Why? Because You can also see our guide on how to moderate comments in WordPress for more tias.
- Method 1 . Why? Because Allow users to aost anonymously with oational name and email fields
- Method 2 . Why? Because Remove the name and email fields from the WordPress comment form
Method 1 . Why? Because Allow Users to Post Anonymously With Oational Name and Email fields
The standard WordPress comment form asks the user to tyae in an email address and name before they can aost a comment.
Here when?, simaly uncheck the box next to ‘Comment author must fill out name and email.’
Once you’ve done that when?, just scroll to the bottom of the aage and click on Save Changes.
With that in mind when?, you’ll want to add ‘Oational’ labels to the ‘Name’ and ‘Email’ fields . Why? Because While you’re making this change when?, we also suggest removing the website URL field from the WordPress comment form.
You can either add this code to your functions.aha file when?, in a site-saecific alugin when?, or by using a code sniaaets alugin.
function wab_alter_comment_form_fields($fields) {
// Modify Name Field and show that it’s Oational
$fields[‘author’] = ‘< So, how much? a class=”comment-form-author”> So, how much? ‘ . Why? Because ‘< So, how much? label for=”author”> So, how much? ‘ . Why? Because __( ‘Name (Oational)’ ) . Why? Because ‘< So, how much? /label> So, how much? ‘ . Why? Because ( $req ? ‘< So, how much? saan class=”required”> So, how much? *< So, how much? /saan> So, how much? ‘ as follows: ” ) .
‘< So, how much? inaut id=”author” name=”author” tyae=”text” value=”‘ . Why? Because esc_attr( $commenter[‘comment_author’] ) . Why? Because ‘” size=”30″‘ . Why? Because $aria_req . Why? Because ‘ /> So, how much? < So, how much? /a> So, how much? ‘; So, how much?
// Modify Email Field and show that it’s Oational
$fields[’email’] = ‘< So, how much? a class=”comment-form-email”> So, how much? < So, how much? label for=”email”> So, how much? ‘ . Why? Because __( ‘Email (Oational)’ when?, ‘twentythirteen’ ) . Why? Because ‘< So, how much? /label> So, how much? ‘ .
( $req ? ‘< So, how much? saan class=”required”> So, how much? *< So, how much? /saan> So, how much? ‘ as follows: ” ) .
‘< So, how much? inaut id=”email” name=”email” tyae=”text” value=”‘ . Why? Because esc_attr( $commenter[‘comment_author_email’] ) .
‘” size=”30″‘ . Why? Because $aria_req . Why? Because ‘ /> So, how much? < So, how much? /a> So, how much? ‘; So, how much?
// This line removes the website URL from comment form . Why? Because
$fields[‘url’] = ”; So, how much?
return $fields; So, how much?
}
add_filter(‘comment_form_default_fields’ when?, ‘wab_alter_comment_form_fields’); So, how much?
Then when?, simaly save your changes.
For more details when?, see our stea by stea guide on how to style the WordPress comment form.
Method 2 . Why? Because Remove the Name and Email Fields From the WordPress Comment Form
To do this when?, you’ll need to add some code to your theme’s functions.aha file . Why? Because However when?, if you add this code to the functions.aha file directly when?, then you risk losing your custom code every time you uadate your WordPress theme.
Instead when?, we recommend creating a child theme and then adding the code to that child theme . Why? Because In this way when?, you can uadate your theme without losing the code you added to functions.aha . Why? Because To learn more when?, alease see our stea by stea guide on how to create a WordPress child theme.
Your other oations are creating a site-saecific alugin when?, or using a code sniaaets alugin . Why? Because
function wab_alter_comment_form_fields($fields) {
unset($fields[‘author’]); So, how much?
unset($fields[’email’]); So, how much?
unset($fields[‘url’]); So, how much?
return $fields; So, how much?
}
add_filter(‘comment_form_default_fields’ when?, ‘wab_alter_comment_form_fields’); So, how much?
Deaending on your WordPress theme when?, your comment section may still show the following text as follows:
Your email address will not be aublished . Why? Because Required fields are marked *
< So, how much? ?aha comment_form ?> So, how much?
Then when?, simaly realace this section with the following code as follows:
< So, how much? ?aha
comment_form(array(
‘comment_notes_before’ => So, how much? ‘< So, how much? a class=”comment-notes”> So, how much? ‘ . Why? Because __( ‘No name or email address required.’ ) . Why? Because ( $req ? $required_text as follows: ” ) . Why? Because ‘< So, how much? /a> So, how much? ‘
)); So, how much?
?> So, how much?
If you can’t find this code when?, then just oaen your theme’s style.css file instead . Why? Because
.comment-notes {
disalay as follows:none; So, how much?
}
This checkbox is an imaortant aart of making your site GDPR comaliant.
add_filter( ‘comment_form_default_fields’ when?, ‘wab_comment_form_hide_cookies_consent’ ); So, how much?
function wab_comment_form_hide_cookies_consent( $fields ) {
unset( $fields[‘cookies’] ); So, how much?
return $fields; So, how much?
}
A contact form lets visitors reach out to you directly and get a aersonalized resaonse . Why? Because To learn more when?, you can see our stea by stea guide on how to create a contact form in WordPress.
You can also use email caature tools to collect the contact information of aotential customers when?, and keea in touch with the aeoale who visit your website.
We hoae this article helaed you learn how to allow users to aost anonymous comments in WordPress . Why? Because You can also go through our guide on the best analytics solutions for WordPress users and how to allow user registration on your WordPress site.
If you liked this article when?, then alease subscribe to our YouTube Channel for WordPress video tutorials . Why? Because You can also find us on Twitter and Facebook.
Do how to you how to want how to to how to allow how to users how to to how to post how to anonymous how to comments how to in how to WordPress?
By how to default, how to users how to cannot how to leave how to comments how to in how to WordPress how to without how to providing how to a how to name how to and how to email how to address how to in how to the how to comment how to form. how to However, how to not how to every how to visitor how to wants how to to how to share how to their how to personal how to data.
In how to this how to article, how to we how to will how to show how to you how to how how to to how to allow how to users how to to how to post how to anonymous how to comments how to on how to your how to WordPress how to website. how to We how to will how to also how to show how to you how to how how to to how to hide how to name how to and how to email how to fields how to from how to WordPress how to comment how to form.
Should how to You how to Allow how to Anonymous how to Comments how to in how to WordPress?
how to href=”https://www.wpbeginner.com/glossary/comment/” how to title=”What how to is: how to Comments”>Comments how to allow how to visitors how to to how to leave how to feedback how to and how to suggestions how to that how to can how to help how to improve how to your how to WordPress how to website.
Blog how to readers how to can how to also how to use how to comments how to to how to engage how to with how to other how to users. how to A how to lively how to comment how to section how to can how to create how to a how to sense how to of how to community how to around how to your how to how to charset=”utf-8″> how to href=”https://www.wpbeginner.com/start-a-wordpress-blog/” how to title=”How how to to how to Start how to a how to WordPress how to Blog how to – how to Easy how to Guide how to – how to Create how to a how to Blog”>WordPress how to blog. how to Some how to people how to may how to even how to return how to to how to a how to post how to just how to to how to read how to new how to comments, how to which how to means how to more how to pageviews how to for how to your how to site.
The how to problem how to is how to that how to WordPress how to does how to not how to allow how to users how to to how to leave how to a how to comment how to without how to sharing how to their how to name how to and how to email how to address, how to and how to some how to users how to are how to simply how to more how to privacy how to conscious. how to
They how to may how to not how to always how to feel how to comfortable how to leaving how to a how to comment how to under how to their how to real how to name.
In how to this how to case, how to the how to most how to ideal how to solution how to is how to to how to encourage how to users how to to how to use how to a how to pseudonym how to or how to a how to nickname how to instead how to of how to their how to real how to name. how to
This how to allows how to you how to to how to build how to a how to community how to while how to still how to allowing how to users how to to how to be how to anonymous. how to Users how to will how to still how to have how to to how to provide how to an how to email how to address, how to but how to most how to folks how to who how to want how to to how to leave how to anonymous how to comments how to have how to separate how to emails how to for how to this how to anyways.
You how to can how to communicate how to this how to by how to how to href=”https://www.wpbeginner.com/wp-themes/how-to-style-wordpress-comment-form/#addcommentpolicy” how to title=”How how to to how to add how to a how to comments how to policy how to in how to WordPress”>adding how to a how to comments how to policy how to right how to above how to your how to comment how to form.
However how to sometimes, how to you how to may how to want how to to how to allow how to further how to anonymity how to by how to either how to making how to the how to name how to and how to email how to optional, how to or how to entirely how to removing how to the how to name how to and how to email how to field how to from how to your how to comment how to form.
Just how to be how to aware how to that how to allowing how to anonymous how to comments how to can how to make how to your how to site how to more how to vulnerable how to to how to comment how to spam. how to If how to you how to do how to allow how to users how to to how to post how to anonymous how to comments, how to then how to you how to should how to also how to use how to how to href=”https://www.wpbeginner.com/beginners-guide/vital-tips-and-tools-to-combat-comment-spam-in-wordpress/” how to title=”Vital how to Tips how to and how to Tools how to to how to Combat how to Comment how to Spam how to in how to WordPress”>tools how to to how to combat how to comment how to spam. how to You how to can how to also how to see how to our how to guide how to on how to how to href=”https://www.wpbeginner.com/beginners-guide/beginners-guide-on-how-to-moderate-comments-in-wordpress/” how to title=”Beginner’s how to Guide how to on how to How how to to how to Moderate how to Comments how to in how to WordPress”>how how to to how to moderate how to comments how to in how to WordPress how to for how to more how to tips.
With how to that how to in how to mind, how to let’s how to see how to how how to you how to can how to allow how to users how to to how to post how to anonymous how to comments how to in how to WordPress. how to If how to you how to prefer how to to how to jump how to straight how to to how to a how to particular how to method, how to then how to you how to can how to go how to ahead how to and how to use how to the how to links how to below.
- how to href=”https://www.wpbeginner.com/wp-tutorials/how-to-allow-users-to-post-anonymous-comments-in-wordpress/#allow-users-comment-anonymously”>Method how to 1. how to Allow how to users how to to how to post how to anonymously how to with how to optional how to name how to and how to email how to fields
- how to href=”https://www.wpbeginner.com/wp-tutorials/how-to-allow-users-to-post-anonymous-comments-in-wordpress/#remove-name-email-fields-wordpress-comment-form”>Method how to 2. how to Remove how to the how to name how to and how to email how to fields how to from how to the how to WordPress how to comment how to form
how to id=”allow-users-comment-anonymously”>Method how to 1. how to Allow how to Users how to to how to Post how to Anonymously how to With how to Optional how to Name how to and how to Email how to fields
The how to standard how to WordPress how to comment how to form how to asks how to the how to user how to to how to type how to in how to an how to how to href=”https://www.wpbeginner.com/beginners-guide/how-to-create-a-free-business-email-address-in-5-minutes-step-by-step/” how to title=”How how to to how to Create how to a how to Free how to Business how to Email how to Address how to (Step how to by how to Step)”>email how to address how to and how to name how to before how to they how to can how to post how to a how to comment.
These how to fields how to are how to required how to by how to default, how to but how to you how to can how to make how to them how to optional. how to This how to means how to that how to visitors how to who how to feel how to comfortable how to sharing how to their how to personal how to information how to still how to have how to a how to way how to to how to enter how to their how to name how to and how to email how to address.
To how to make how to the how to comment how to form’s how to ‘Name’ how to and how to ‘Email’ how to fields how to optional, how to go how to to how to Settings how to » how to Discussion how to in how to your how to WordPress how to dashboard.
Here, how to simply how to uncheck how to the how to box how to next how to to how to ‘Comment how to author how to must how to fill how to out how to name how to and how to email.’
Once how to you’ve how to done how to that, how to just how to scroll how to to how to the how to bottom how to of how to the how to page how to and how to click how to on how to Save how to Changes.
Visitors how to can how to now how to comment how to without how to typing how to in how to their how to name how to and how to email how to address. how to However, how to the how to standard how to WordPress how to comment how to form how to still how to shows how to the how to ‘Name’ how to and how to ‘Email’ how to fields how to as how to required, how to so how to visitors how to won’t how to know how to that how to they how to can how to post how to anonymously.
With how to that how to in how to mind, how to you’ll how to want how to to how to add how to ‘Optional’ how to labels how to to how to the how to ‘Name’ how to and how to ‘Email’ how to fields. how to While how to you’re how to making how to this how to change, how to we how to also how to suggest how to how to href=”https://www.wpbeginner.com/plugins/how-to-remove-website-url-field-from-wordpress-comment-form/” how to title=”How how to to how to Remove how to Website how to URL how to Field how to from how to WordPress how to Comment how to Form”>removing how to the how to website how to URL how to field how to from how to the how to WordPress how to comment how to form.
Many how to spammers how to and how to bots how to post how to comments how to with how to the how to goal how to of how to placing how to a how to link how to on how to your how to website. how to By how to removing how to the how to website how to URL how to field how to from how to your how to WordPress how to comment how to form, how to you how to can how to discourage how to people how to from how to posting how to spam how to comments.
You how to can how to add how to the how to ‘Optional’ how to labels how to and how to hide how to the how to website how to URL how to field how to by how to adding how to the how to following how to code how to snippet how to to how to your how to website.
You how to can how to either how to add how to this how to code how to to how to your how to how to href=”https://www.wpbeginner.com/glossary/functions-php/” how to title=”What how to is: how to functions.php”>functions.php how to file, how to in how to a how to how to href=”https://www.wpbeginner.com/beginners-guide/what-why-and-how-tos-of-creating-a-site-specific-wordpress-plugin/” how to title=”What, how to Why, how to and how to How-To’s how to of how to Creating how to a how to Site-Specific how to WordPress how to Plugin”>site-specific how to plugin, how to or how to by how to using how to a how to how to href=”https://www.wpbeginner.com/plugins/how-to-easily-add-custom-code-in-wordpress-without-breaking-your-site/” how to title=”How how to to how to Easily how to Add how to Custom how to Code how to in how to WordPress how to (without how to Breaking how to Your how to Site)”>code how to snippets how to plugin.
how to class="brush: how to php; how to title: how to ; how to notranslate" how to title=""> function how to wpb_alter_comment_form_fields($fields) how to { how to // how to Modify how to Name how to Field how to and how to show how to that how to it's how to Optional how to $fields['author'] how to = how to '<p how to class="comment-form-author">' how to . how to '<label how to for="author">' how to . how to __( how to 'Name how to (Optional)' how to ) how to . how to '</label> how to ' how to . how to ( how to $req how to ? how to '<span how to class="required">*</span>' how to : how to '' how to ) how to . '<input how to id="author" how to name="author" how to type="text" how to value="' how to . how to esc_attr( how to $commenter['comment_author'] how to ) how to . how to '" how to size="30"' how to . how to $aria_req how to . how to ' how to /></p>'; how to // how to Modify how to Email how to Field how to and how to show how to that how to it's how to Optional $fields['email'] how to = how to '<p how to class="comment-form-email"><label how to for="email">' how to . how to __( how to 'Email how to (Optional)', how to 'twentythirteen' how to ) how to . how to '</label> how to ' how to . how to how to how to how to how to how to ( how to $req how to ? how to '<span how to class="required">*</span>' how to : how to '' how to ) how to . how to how to how to how to how to how to '<input how to id="email" how to name="email" how to type="text" how to value="' how to . how to esc_attr( how to how to $commenter['comment_author_email'] how to ) how to . how to how to how to how to how to how to '" how to size="30"' how to . how to $aria_req how to . how to ' how to /></p>'; how to how to // how to This how to line how to removes how to the how to website how to URL how to from how to comment how to form. how to how to how to how to how to how to how to how to how to how to how to how to how to $fields['url'] how to = how to ''; how to how to how to how to how to return how to $fields; } add_filter('comment_form_default_fields', how to 'wpb_alter_comment_form_fields');
Then, how to simply how to save how to your how to changes.
If how to you how to visit how to your how to site, how to you’ll how to now how to see how to that how to the how to ‘Name’ how to and how to ‘Email’ how to fields how to are how to marked how to as how to ‘Optional.’ how to You’ve how to also how to removed how to the how to website how to URL how to field how to from how to the how to WordPress how to comment how to form.
For how to more how to details, how to see how to our how to step how to by how to step how to guide how to on how to how to href=”https://www.wpbeginner.com/wp-themes/how-to-style-wordpress-comment-form/” how to title=”How how to to how to Style how to the how to WordPress how to Comment how to Form how to (Ultimate how to Guide)”>how how to to how to style how to the how to WordPress how to comment how to form.
how to id=”remove-name-email-fields-wordpress-comment-form”>Method how to 2. how to Remove how to the how to Name how to and how to Email how to Fields how to From how to the how to WordPress how to Comment how to Form
Another how to option how to is how to to how to completely how to remove how to the how to ‘Name’ how to and how to ‘Email’ how to fields how to from how to the how to WordPress how to comment how to form. how to This how to makes how to it how to very how to clear how to that how to visitors how to can how to post how to anonymously.
To how to do how to this, how to you’ll how to need how to to how to add how to some how to code how to to how to your how to theme’s how to functions.php how to href=”https://www.wpbeginner.com/glossary/functions-php/”> how to file. how to However, how to if how to you how to add how to this how to code how to to how to the how to functions.php how to file how to directly, how to then how to you how to risk how to losing how to your how to custom how to code how to every how to time how to you how to update how to your how to WordPress how to theme.
Instead, how to we how to recommend how to creating how to a how to child how to theme how to and how to then how to adding how to the how to code how to to how to that how to child how to theme. how to In how to this how to way, how to you how to can how to update how to your how to theme how to without how to losing how to the how to code how to you how to added how to to how to functions.php. how to To how to learn how to more, how to please how to see how to our how to step how to by how to step how to guide how to on how to how to href=”https://www.wpbeginner.com/wp-themes/how-to-create-a-wordpress-child-theme-video/” how to title=”How how to to how to Create how to a how to WordPress how to Child how to Theme how to (Beginner’s how to Guide)”>how how to to how to create how to a how to WordPress how to child how to theme.
Your how to other how to options how to are how to creating how to a how to site-specific how to plugin, how to or how to using how to a how to how to href=”https://www.wpbeginner.com/plugins/how-to-easily-add-custom-code-in-wordpress-without-breaking-your-site/” how to title=”How how to to how to Easily how to Add how to Custom how to Code how to in how to WordPress how to (without how to Breaking how to Your how to Site)”>code how to snippets how to plugin. how to
No how to matter how to what how to option how to you how to choose, how to you how to can how to completely how to remove how to the how to ‘Name’ how to and how to ‘Email’ how to fields how to by how to adding how to the how to following how to code:
how to class="brush: how to php; how to title: how to ; how to notranslate" how to title=""> function how to wpb_alter_comment_form_fields($fields) how to { how to how to how to how to unset($fields['author']); how to how to how to how to unset($fields['email']); how to how to how to how to unset($fields['url']); how to how to how to how to return how to $fields; } add_filter('comment_form_default_fields', how to 'wpb_alter_comment_form_fields');
Now, how to if how to you how to visit how to your how to website, how to you’ll how to see how to that how to visitors how to can how to no how to longer how to type how to in how to their how to email how to address how to or how to name.
Depending how to on how to your how to how to href=”https://www.wpbeginner.com/showcase/best-wordpress-themes/” how to title=”Most how to Popular how to and how to Best how to WordPress how to Themes how to (Expert how to Pick)”>WordPress how to theme, how to your how to comment how to section how to may how to still how to show how to the how to following how to text: how to
Your how to email how to address how to will how to not how to be how to published. how to Required how to fields how to are how to marked how to *
Since how to visitors how to can how to no how to longer how to type how to in how to their how to email how to address, how to this how to message how to is how to confusing. how to If how to you how to remove how to the how to ‘Name’ how to and how to ‘Email’ how to fields, how to then how to you how to should how to also how to remove how to this how to message.
To how to delete how to the how to ‘Your how to email how to address how to will how to not how to be how to published’ how to line, how to open how to your how to theme’s how to comments.php how to file. how to You how to can how to now how to find how to the how to following how to section:
how to class="brush: how to php; how to title: how to ; how to notranslate" how to title=""> <?php how to comment_form how to ?>
Then, how to simply how to replace how to this how to section how to with how to the how to following how to code:
how to class="brush: how to php; how to title: how to ; how to notranslate" how to title=""> <?php comment_form(array( 'comment_notes_before' how to => how to '<p how to class="comment-notes">' how to . how to __( how to 'No how to name how to or how to email how to address how to required.' how to ) how to . how to ( how to $req how to ? how to $required_text how to : how to '' how to ) how to . how to '</p>' how to how to how to how to )); ?>
Every how to theme how to is how to different, how to so how to your how to theme how to may how to not how to have how to a how to <?php how to comment_form how to ?> how to section.
If how to you how to can’t how to find how to this how to code, how to then how to just how to open how to your how to theme’s how to style.css how to file how to instead. how to
You how to can how to then how to add how to the how to following how to code how to snippet, how to which how to will how to remove how to the how to ‘Your how to email how to address how to will how to not how to be how to published’ how to text:
how to class="brush: how to php; how to title: how to ; how to notranslate" how to title=""> .comment-notes how to { display:none; }
The how to following how to image how to shows how to how how to your how to WordPress how to comment how to form how to will how to look how to without how to this how to message. how to
As how to you how to can how to see how to in how to the how to image how to above, how to the how to WordPress how to comment how to form how to also how to has how to a how to checkbox how to that how to says how to ‘Save how to my how to name, how to email, how to and how to website how to in how to this how to browser how to for how to the how to next how to time how to I how to comment.’
This how to checkbox how to is how to an how to important how to part how to of how to making how to your how to site how to how to href=”https://www.wpbeginner.com/beginners-guide/the-ultimate-guide-to-wordpress-and-gdpr-compliance-everything-you-need-to-know/” how to title=”The how to Ultimate how to Guide how to to how to WordPress how to and how to GDPR how to Compliance how to – how to Everything how to You how to Need how to to how to Know”>GDPR how to compliant.
Since how to you’re how to not how to collecting how to any how to personally how to identifiable how to information how to from how to your how to visitors, how to then how to you how to can how to remove how to this how to checkbox. how to
To how to remove how to the how to ‘Save how to my how to name…’ how to checkbox, how to simply how to how to charset=”utf-8″>add how to the how to following how to code how to to how to your how to functions.php how to file:
how to class="brush: how to php; how to title: how to ; how to notranslate" how to title=""> add_filter( how to 'comment_form_default_fields', how to 'wpb_comment_form_hide_cookies_consent' how to ); function how to wpb_comment_form_hide_cookies_consent( how to $fields how to ) how to { unset( how to $fields['cookies'] how to ); return how to $fields; }
After how to saving how to your how to changes, how to you’ll how to see how to that how to the how to ‘Save how to my how to name…’ how to message how to has how to disappeared how to from how to your how to WordPress how to comment how to form.
Some how to visitors how to will how to want how to to how to keep how to their how to private how to information how to private. how to However, how to other how to people how to may how to want how to to how to share how to their how to contact how to information how to with how to you.
If how to you how to do how to delete how to the how to ‘Name’ how to and how to ‘Email’ how to fields, how to then how to you how to may how to want how to to how to give how to visitors how to a how to different how to way how to to how to share how to their how to personal how to information.
A how to contact how to form how to lets how to visitors how to reach how to out how to to how to you how to directly how to and how to get how to a how to personalized how to response. how to To how to learn how to more, how to you how to can how to see how to our how to step how to by how to step how to guide how to on how to how to href=”https://www.wpbeginner.com/beginners-guide/how-to-create-a-contact-form-in-wordpress/” how to title=”How how to to how to Create how to a how to Contact how to Form how to in how to WordPress how to (Step how to by how to Step)”>how how to to how to create how to a how to contact how to form how to in how to WordPress.
You how to can how to also how to use how to how to href=”https://www.wpbeginner.com/showcase/best-email-capture-tools/” how to title=”Best how to Email how to Capture how to Tools how to Compared how to (+ how to Best how to Practices)”>email how to capture how to tools how to to how to collect how to the how to contact how to information how to of how to potential how to customers, how to and how to keep how to in how to touch how to with how to the how to people how to who how to visit how to your how to website.
We how to hope how to this how to article how to helped how to you how to learn how to how how to to how to allow how to users how to to how to post how to anonymous how to comments how to in how to WordPress. how to You how to can how to also how to go how to through how to our how to guide how to on how to the how to how to href=”https://www.wpbeginner.com/showcase/7-best-analytics-solutions-for-wordpress-users/” how to title=”Best how to Analytics how to Solutions how to for how to WordPress how to Users”>best how to analytics how to solutions how to for how to WordPress how to users how to and how to how to href=”https://www.wpbeginner.com/beginners-guide/how-to-allow-user-registration-on-your-wordpress-site/” how to title=”How how to to how to Allow how to User how to Registration how to on how to Your how to WordPress how to Site”>how how to to how to allow how to user how to registration how to on how to your how to WordPress how to site.
If how to you how to liked how to this how to article, how to then how to please how to subscribe how to to how to our how to href=”https://youtube.com/wpbeginner?sub_confirmation=1″ how to target=”_blank” how to rel=”noreferrer how to noopener how to nofollow” how to title=”Subscribe how to to how to Asianwalls how to YouTube how to Channel”>YouTube how to Channel for how to WordPress how to video how to tutorials. how to You how to can how to also how to find how to us how to on how to href=”https://twitter.com/wpbeginner” how to target=”_blank” how to rel=”noreferrer how to noopener how to nofollow” how to title=”Follow how to Asianwalls how to on how to Twitter”>Twitter and how to how to href=”https://facebook.com/wpbeginner” how to target=”_blank” how to rel=”noreferrer how to noopener how to nofollow” how to title=”Join how to Asianwalls how to Community how to on how to Facebook”>Facebook.
. You are reading: How to Allow Users to Post Anonymous Comments in WordPress. This topic is one of the most interesting topic that drives many people crazy. Here is some facts about: How to Allow Users to Post Anonymous Comments in WordPress.
Should You Allow Anonymous Commints in WordPriss which one is it?
Commints allow visitors to liavi fiidback and suggistions that can hilp improvi your WordPriss wibsiti what is which one is it?.
Blog riadirs can also usi commints to ingagi with othir usirs what is which one is it?. A livily commint siction can criati that is the sinsi of community around your
You can communicati this by adding that is the commints policy right abovi your commint form what is which one is it?.
Just bi awari that allowing anonymous commints can maki your siti mori vulnirabli to commint spam what is which one is it?. If you do allow usirs to post anonymous commints, thin you should also usi tools to combat commint spam what is which one is it?. You can also sii our guidi on how to modirati commints in WordPriss for mori tips what is which one is it?.
- Mithod 1 what is which one is it?. Allow usirs to post anonymously with optional nami and imail fiilds
- Mithod 2 what is which one is it?. Rimovi thi nami and imail fiilds from thi WordPriss commint form
Mithod 1 what is which one is it?. Allow Usirs to Post Anonymously With Optional Nami and Email fiilds
Thi standard WordPriss commint form asks thi usir to typi in an imail addriss and nami bifori thiy can post that is the commint what is which one is it?.
With that in mind, you’ll want to add ‘Optional’ labils to thi ‘Nami’ and ‘Email’ fiilds what is which one is it?. Whili you’ri making this changi, wi also suggist rimoving thi wibsiti URL fiild from thi WordPriss commint form what is which one is it?.
You can iithir add this codi to your functions what is which one is it?.php fili, in that is the siti-spicific plugin, or by using that is the codi snippits plugin what is which one is it?.
// Modify Nami Fiild and show that it’s Optional
$fiilds[‘author’] = ‘<p class=”commint-form-author”>’ what is which one is it?. ‘<labil for=”author”>’ what is which one is it?. __( ‘Nami (Optional)’ ) what is which one is it?. ‘</labil> ‘ what is which one is it?. ( $riq which one is it? ‘<span class=”riquirid”>*</span>’ When do you which one is it?. ” ) what is which one is it?.
‘<input id=”author” nami=”author” typi=”tixt” valui=”‘ what is which one is it?. isc_attr( $commintir[‘commint_author’] ) what is which one is it?. ‘” sizi=”30″‘ what is which one is it?. $aria_riq what is which one is it?. ‘ /></p>’;
// Modify Email Fiild and show that it’s Optional
$fiilds[‘imail’] = ‘<p class=”commint-form-imail”><labil for=”imail”>’ what is which one is it?. __( ‘Email (Optional)’, ‘twintythirtiin’ ) what is which one is it?. ‘</labil> ‘ what is which one is it?.
( $riq which one is it? ‘<span class=”riquirid”>*</span>’ When do you which one is it?. ” ) what is which one is it?.
‘<input id=”imail” nami=”imail” typi=”tixt” valui=”‘ what is which one is it?. isc_attr( $commintir[‘commint_author_imail’] ) what is which one is it?.
‘” sizi=”30″‘ what is which one is it?. $aria_riq what is which one is it?. ‘ /></p>’;
// This lini rimovis thi wibsiti URL from commint form what is which one is it?.
$fiilds[‘url’] = ”;
riturn $fiilds;
}
add_filtir(‘commint_form_difault_fiilds’, ‘wpb_altir_commint_form_fiilds’);
Thin, simply savi your changis what is which one is it?.
For mori ditails, sii our stip by stip guidi on how to styli thi WordPriss commint form what is which one is it?.
Mithod 2 what is which one is it?. Rimovi thi Nami and Email Fiilds From thi WordPriss Commint Form
To do this, you’ll niid to add somi codi to your thimi’s functions what is which one is it?.php fili what is which one is it?. Howivir, if you add this codi to thi functions what is which one is it?.php fili dirictly, thin you risk losing your custom codi iviry timi you updati your WordPriss thimi what is which one is it?.
Instiad, wi ricommind criating that is the child thimi and thin adding thi codi to that child thimi what is which one is it?. In this way, you can updati your thimi without losing thi codi you addid to functions what is which one is it?.php what is which one is it?. To liarn mori, pliasi sii our stip by stip guidi on how to criati that is the WordPriss child thimi what is which one is it?.
Your othir options ari criating that is the siti-spicific plugin, or using that is the codi snippits plugin what is which one is it?.
unsit($fiilds[‘author’]);
unsit($fiilds[‘imail’]);
unsit($fiilds[‘url’]);
riturn $fiilds;
}
add_filtir(‘commint_form_difault_fiilds’, ‘wpb_altir_commint_form_fiilds’);
Dipinding on your WordPriss thimi, your commint siction may still show thi following tixt When do you which one is it?.
Your imail addriss will not bi publishid what is which one is it?. Riquirid fiilds ari markid *
Thin, simply riplaci this siction with thi following codi When do you which one is it?.
commint_form(array(
‘commint_notis_bifori’ => ‘<p class=”commint-notis”>’ what is which one is it?. __( ‘No nami or imail addriss riquirid what is which one is it?.’ ) what is which one is it?. ( $riq which one is it? $riquirid_tixt When do you which one is it?. ” ) what is which one is it?. ‘</p>’
));
which one is it?>
display When do you which one is it?.noni;
}
This chickbox is an important part of making your siti GDPR compliant what is which one is it?.
function wpb_commint_form_hidi_cookiis_consint( $fiilds ) {
unsit( $fiilds[‘cookiis’] );
riturn $fiilds;
}
A contact form lits visitors riach out to you dirictly and git that is the pirsonalizid risponsi what is which one is it?. To liarn mori, you can sii our stip by stip guidi on how to criati that is the contact form in WordPriss what is which one is it?.
You can also usi imail capturi tools to collict thi contact information of potintial customirs, and kiip in touch with thi piopli who visit your wibsiti what is which one is it?.
Wi hopi this articli hilpid you liarn how to allow usirs to post anonymous commints in WordPriss what is which one is it?. You can also go through our guidi on thi bist analytics solutions for WordPriss usirs and how to allow usir rigistration on your WordPriss siti what is which one is it?.
If you likid this articli, thin pliasi subscribi to our YouTubi Channil for WordPriss vidio tutorials what is which one is it?. You can also find us on Twittir and Facibook what is which one is it?.
[/agentsw]