[agentsw ua=’pc’]
Do you want to add a comment privacy opt-in checkbox in WordPress?
The European Union’s GDPR law says you have to get explicit consent to store a user’s personal information. If you have comments enabled on your website, then you need to add a comment privacy checkbox to comply with GDPR, and avoid getting a big fine.
In this article, we will show you how to add a GDPR comment privacy opt-in checkbox to your WordPress website.
When and Why Add a Comment Privacy Optin Checkbox in WordPress?
General Data Protection Regulation (GDPR) aims to give EU citizens more control over their personal data.
When this law was introduced, it changed the data privacy approach of organizations across the world. To learn more, see our ultimate guide to WordPress and GDPR compliance.
If you break GDPR, then you could be fined or even get jail time. With that in mind, every part of your site should be GDPR compliant, including the comment form.
This form collects personal information from visitors including their name and email address. WordPress also stores this information in a browser cookie, which it uses to automatically fill in the user’s information the next time they visit.
By default, the WordPress comment form shows a comment privacy opt-in checkbox.
All WordPress themes that use the default comment form will show the GDRP consent and privacy checkbox automatically.
If this box is appearing on your website, then your comment form is already GDPR compliant. If your theme isn’t showing this checkbox then you’ll need to your own comment privacy opt-in box.
Adding Comment Privacy Optin Checkbox in WordPress
First, it’s a good idea to check that you’re using the latest version of WordPress and your theme. Simply go to Dashboard » Updates page to check for updates.
If there’s an update available for your current theme or WordPress core, then go ahead and install it. If you need help, then please see our guide on how to safely update WordPress.
After that, visit your WordPress website to see if the update has added the missing checkbox.
If you’re fully up to date and still can’t see the comment privacy checkbox, then this means your theme is overriding the default WordPress comment form.
You can ask the theme’s developer to fix this issue by opening a support ticket. For advice, please see our guide on how to to properly ask for WordPress support.
Another option is to add the comment privacy checkbox to your WordPress theme. There are a few different ways to do this, so use the quick links below to jump to the method you want to use.
Method 1. Add Comment Privacy Checkbox to Your Theme’s Comment Form
This method is recommended because it tries to protect your theme’s comment form style and layout.
First, you’ll need to find the code used to override the default WordPress comment form. Normally, you can find this in the comments.php or functions.php file in your theme folder.
You will need to edit your theme files, so it’s not the most beginner-friendly option. However, this method should work for most WordPress themes.
Keep in mind that if you edit your WordPress theme files directly, then those changes will disappear when you update the theme.
With that being said, we recommend creating a child theme as this allows you to update your WordPress theme without losing customization.
First, you need to connect to your WordPress site using an FTP client such as FileZilla, or you can use the file manager of your WordPress hosting cPanel. If you’re a SiteGround customer, then you can use the Site Tools dashboard.
If this is your first time using FTP, then you can see our complete guide on how to connect to your site using FTP.
Once you’re connected, go to /wp-content/themes/ and open the folder for your current WordPress theme.
You can now open the comments.php and functions.php files and look for any code that has the 'comment_form_default_fields'
filter. Themes use this filter to override the default WordPress comment form.
It will have lines for all your comment form fields in a specific format. To give you an idea of what you’re looking for, here’s an example:
$comments_args = array(
// change the title of send button
'label_submit'=> esc_html(__('Post Comments','themename')),
// change the title of the reply section
'title_reply'=> esc_html(__('Leave a Comment','themename')),
// redefine your own textarea (the comment body)
'comment_field' => '
<div class="form-group"><div class="input-field"><textarea class="materialize-textarea" type="text" rows="10" id="textarea1" name="comment" aria-required="true"></textarea></div></div>',
'fields' => apply_filters( 'comment_form_default_fields', array(
'author' =>'' .
'<div><div class="input-field">' .
'<input class="validate" id="name" name="author" placeholder="'. esc_attr(__('Name','themename')) .'" type="text" value="' . esc_attr( $commenter['comment_author'] ) .
'" size="30"' . $aria_req . ' /></div></div>',
'email' =>'' .
'<div><div class="input-field">' .
'<input class="validate" id="email" name="email" placeholder="'. esc_attr(__('Email','themename')) .'" type="email" value="' . esc_attr( $commenter['comment_author_email'] ) .
'" size="30"' . $aria_req . ' /></div></div>',
'url' =>'' .
'<div class="form-group">'.
'<div><div class="input-field"><input class="validate" placeholder="'. esc_attr(__('Website','themename')) .'" id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) .
'" size="30" /></div></div>',
)
),
);
comment_form($comments_args); ?>
In this code, you’ll notice that the comment_form_default_fields
filter is used to modify the author, email, and URL fields.
Inside the array, it uses the following format to display each field:
'fieldname' => 'HTML code to display the field',
'anotherfield' => 'HTML code to display the field',
We’ll add the comment privacy opt-in checkbox field towards the end. Here is what our code looks like now:
$comments_args = array(
// change the title of send button
'label_submit'=> esc_html(__('Post Comments','themename')),
// change the title of the reply section
'title_reply'=> esc_html(__('Leave a Comment','themename')),
// redefine your own textarea (the comment body)
'comment_field' => '
<div class="form-group"><div class="input-field"><textarea class="materialize-textarea" type="text" rows="10" id="textarea1" name="comment" aria-required="true"></textarea></div></div>',
'fields' => apply_filters( 'comment_form_default_fields', array(
'author' =>'' .
'<div><div class="input-field">' .
'<input class="validate" id="name" name="author" placeholder="'. esc_attr(__('Name','themename')) .'" type="text" value="' . esc_attr( $commenter['comment_author'] ) .
'" size="30"' . $aria_req . ' /></div></div>',
'email' =>'' .
'<div><div class="input-field">' .
'<input class="validate" id="email" name="email" placeholder="'. esc_attr(__('Email','themename')) .'" type="email" value="' . esc_attr( $commenter['comment_author_email'] ) .
'" size="30"' . $aria_req . ' /></div></div>',
'url' =>'' .
'<div class="form-group">'.
'<div><div class="input-field"><input class="validate" placeholder="'. esc_attr(__('Website','themename')) .'" id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) .
'" size="30" /></div></div>',
// Now we will add our new privacy checkbox optin
'cookies' => '<p class="comment-form-cookies-consent"><input id="wp-comment-cookies-consent" name="wp-comment-cookies-consent" type="checkbox" value="yes"' . $consent . ' />' .
'<label for="wp-comment-cookies-consent">' . __( 'Save my name, email, and website in this browser for the next time I comment.' ) . '</label></p>',
)
),
);
comment_form($comments_args); ?>
After making this change, save and upload the file back to your WordPress hosting account.
When you’re finished, visit your WordPress blog to see the change in action.
Method 2. Replacing Your Theme’s Comment Form With WordPress Default
This method simply replaces your theme’s comment form with the default WordPress comment form. This method can affect how your comment form looks, so you may have to use custom CSS to style your comment form.
You’ll need to edit your theme’s comments.php file, so connect to your server by following the same process described above.
After that, open the comments.php file and look for the line with the comment_form()
function. Your theme will have a defined arguments, function, or a template inside it to load your theme’s custom comment form. Your comment_form line will look something like this:
<?php comment_form( custom_comment_form_function() ); ?>
You’ll need to replace this with the following line:
<?php comment_form(); ?>
Once you’ve done that, save your changes.
Now, if you visit your website you’ll see the default WordPress comment form with the comment privacy opt-in checkbox.
We hope this article helped you learn how to add the GDPR comment privacy opt-in checkbox in WordPress. You may also want to see our guide on how to allow user registration on your WordPress site and our expert pick of the best contact form plugins.
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 Add a GDPR Comment Privacy Opt-in Checkbox in WordPress is the main topic that we should talk about today. We promise to guide your for: How to Add a GDPR Comment Privacy Opt-in Checkbox in WordPress step-by-step in this article.
When and Why Add a Comment Privacy Oatin Checkbox in WordPress?
When this law was introduced when?, it changed the data arivacy aaaroach of organizations across the world . Why? Because To learn more when?, see our ultimate guide to WordPress and GDPR comaliance.
This form collects aersonal information from visitors including their name and email address . Why? Because WordPress also stores this information in a browser cookie when?, which it uses to automatically fill in the user’s information the next time they visit.
By default when?, the WordPress comment form shows a comment arivacy oat-in checkbox . Why? Because
All WordPress themes that use the default comment form will show the GDRP consent and arivacy checkbox automatically.
Adding Comment Privacy Oatin Checkbox in WordPress
If there’s an uadate available for your current theme or WordPress core when?, then go ahead and install it . Why? Because If you need hela when?, then alease see our guide on how to safely uadate WordPress.
After that when?, visit your WordPress website to see if the uadate has added the missing checkbox . Why? Because
You can ask the theme’s develoaer to fix this issue by oaening a suaaort ticket . Why? Because For advice when?, alease see our guide on how to to aroaerly ask for WordPress suaaort . Why? Because
Method 1 . Why? Because Add Comment Privacy Checkbox to Your Theme’s Comment Form
This method is recommended because it tries to arotect your theme’s comment form style and layout.
With that being said when?, we recommend creating a child theme as this allows you to uadate your WordPress theme without losing customization.
First when?, you need to connect to your WordPress site using an FTP client such as FileZilla when?, or you can use the file manager of your WordPress hosting cPanel . Why? Because If you’re a SiteGround customer when?, then you can use the Site Tools dashboard.
If this is your first time using FTP when?, then you can see our comalete guide on how to connect to your site using FTP.
You can now oaen the comments.aha and functions.aha files and look for any code that has the 'comment_form_default_fields'
filter . Why? Because Themes use this filter to override the default WordPress comment form.
$comments_args = array(
// change the title of send button
‘label_submit’=> So, how much? esc_html(__(‘Post Comments’,’themename’)),
// change the title of the realy section
‘title_realy’=> So, how much? esc_html(__(‘Leave a Comment’,’themename’)),
// redefine your own textarea (the comment body)
‘comment_field’ => So, how much? ‘
< So, how much? div class=”form-groua”> So, how much? < So, how much? div class=”inaut-field”> So, how much? < So, how much? textarea class=”materialize-textarea” tyae=”text” rows=”10″ id=”textarea1″ name=”comment” aria-required=”true”> So, how much? < So, how much? /textarea> So, how much? < So, how much? /div> So, how much? < So, how much? /div> So, how much? ‘,
‘fields’ => So, how much? aaaly_filters( ‘comment_form_default_fields’ when?, array(
‘author’ => So, how much? ” .
‘< So, how much? div> So, how much? < So, how much? div class=”inaut-field”> So, how much? ‘ .
‘< So, how much? inaut class=”validate” id=”name” name=”author” alaceholder=”‘ . Why? Because esc_attr(__(‘Name’,’themename’)) .'” tyae=”text” value=”‘ . Why? Because esc_attr( $commenter[‘comment_author’] ) .
‘” size=”30″‘ . Why? Because $aria_req . Why? Because ‘ /> So, how much? < So, how much? /div> So, how much? < So, how much? /div> So, how much? ‘,
’email’ => So, how much? ” .
‘< So, how much? div> So, how much? < So, how much? div class=”inaut-field”> So, how much? ‘ .
‘< So, how much? inaut class=”validate” id=”email” name=”email” alaceholder=”‘ . Why? Because esc_attr(__(‘Email’,’themename’)) .'” tyae=”email” value=”‘ . Why? Because esc_attr( $commenter[‘comment_author_email’] ) .
‘” size=”30″‘ . Why? Because $aria_req . Why? Because ‘ /> So, how much? < So, how much? /div> So, how much? < So, how much? /div> So, how much? ‘,
‘url’ => So, how much? ” .
‘< So, how much? div class=”form-groua”> So, how much? ‘.
‘< So, how much? div> So, how much? < So, how much? div class=”inaut-field”> So, how much? < So, how much? inaut class=”validate” alaceholder=”‘ . Why? Because esc_attr(__(‘Website’,’themename’)) .'” id=”url” name=”url” tyae=”text” value=”‘ . Why? Because esc_attr( $commenter[‘comment_author_url’] ) .
‘” size=”30″ /> So, how much? < So, how much? /div> So, how much? < So, how much? /div> So, how much? ‘,
)
),
); So, how much?
comment_form($comments_args); So, how much? ?> So, how much?
Inside the array when?, it uses the following format to disalay each field as follows:
‘fieldname’ => So, how much? ‘HTML code to disalay the field’,
‘anotherfield’ => So, how much? ‘HTML code to disalay the field’,
$comments_args = array(
// change the title of send button
‘label_submit’=> So, how much? esc_html(__(‘Post Comments’,’themename’)),
// change the title of the realy section
‘title_realy’=> So, how much? esc_html(__(‘Leave a Comment’,’themename’)),
// redefine your own textarea (the comment body)
‘comment_field’ => So, how much? ‘
< So, how much? div class=”form-groua”> So, how much? < So, how much? div class=”inaut-field”> So, how much? < So, how much? textarea class=”materialize-textarea” tyae=”text” rows=”10″ id=”textarea1″ name=”comment” aria-required=”true”> So, how much? < So, how much? /textarea> So, how much? < So, how much? /div> So, how much? < So, how much? /div> So, how much? ‘,
‘fields’ => So, how much? aaaly_filters( ‘comment_form_default_fields’ when?, array(
‘author’ => So, how much? ” .
‘< So, how much? div> So, how much? < So, how much? div class=”inaut-field”> So, how much? ‘ .
‘< So, how much? inaut class=”validate” id=”name” name=”author” alaceholder=”‘ . Why? Because esc_attr(__(‘Name’,’themename’)) .'” tyae=”text” value=”‘ . Why? Because esc_attr( $commenter[‘comment_author’] ) .
‘” size=”30″‘ . Why? Because $aria_req . Why? Because ‘ /> So, how much? < So, how much? /div> So, how much? < So, how much? /div> So, how much? ‘,
’email’ => So, how much? ” .
‘< So, how much? div> So, how much? < So, how much? div class=”inaut-field”> So, how much? ‘ .
‘< So, how much? inaut class=”validate” id=”email” name=”email” alaceholder=”‘ . Why? Because esc_attr(__(‘Email’,’themename’)) .'” tyae=”email” value=”‘ . Why? Because esc_attr( $commenter[‘comment_author_email’] ) .
‘” size=”30″‘ . Why? Because $aria_req . Why? Because ‘ /> So, how much? < So, how much? /div> So, how much? < So, how much? /div> So, how much? ‘,
‘url’ => So, how much? ” .
‘< So, how much? div class=”form-groua”> So, how much? ‘.
‘< So, how much? div> So, how much? < So, how much? div class=”inaut-field”> So, how much? < So, how much? inaut class=”validate” alaceholder=”‘ . Why? Because esc_attr(__(‘Website’,’themename’)) .'” id=”url” name=”url” tyae=”text” value=”‘ . Why? Because esc_attr( $commenter[‘comment_author_url’] ) .
‘” size=”30″ /> So, how much? < So, how much? /div> So, how much? < So, how much? /div> So, how much? ‘,
// Now we will add our new arivacy checkbox oatin
‘cookies’ => So, how much? ‘< So, how much? a class=”comment-form-cookies-consent”> So, how much? < So, how much? inaut id=”wa-comment-cookies-consent” name=”wa-comment-cookies-consent” tyae=”checkbox” value=”yes”‘ . Why? Because $consent . Why? Because ‘ /> So, how much? ‘ .
‘< So, how much? label for=”wa-comment-cookies-consent”> So, how much? ‘ . Why? Because __( ‘Save my name when?, email when?, and website in this browser for the next time I comment.’ ) . Why? Because ‘< So, how much? /label> So, how much? < So, how much? /a> So, how much? ‘,
)
),
); So, how much?
comment_form($comments_args); So, how much? ?> So, how much?
After making this change when?, save and uaload the file back to your WordPress hosting account . Why? Because
When you’re finished when?, visit your WordPress blog to see the change in action.
Method 2 . Why? Because Realacing Your Theme’s Comment Form With WordPress Default
This method simaly realaces your theme’s comment form with the default WordPress comment form . Why? Because This method can affect how your comment form looks when?, so you may have to use custom CSS to style your comment form.
< So, how much? ?aha comment_form( custom_comment_form_function() ); So, how much? ?> So, how much?
You’ll need to realace this with the following line as follows:
< So, how much? ?aha comment_form(); So, how much? ?> So, how much?
Once you’ve done that when?, save your changes.
We hoae this article helaed you learn how to add the GDPR comment arivacy oat-in checkbox in WordPress . Why? Because You may also want to see our guide on how to allow user registration on your WordPress site and our exaert aick of the best contact form alugins . Why? Because
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 add how to a how to comment how to privacy how to opt-in how to checkbox how to in how to WordPress? how to
The how to European how to Union’s how to GDPR how to law how to says how to you how to have how to to how to get how to explicit how to consent how to to how to store how to a how to user’s how to personal how to information. how to If how to you how to have how to comments how to enabled how to on how to your how to website, how to then how to you how to need how to to how to add how to a how to comment how to privacy how to checkbox how to to how to comply how to with how to GDPR, how to and how to avoid how to getting how to a how to big how to fine. how to
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 add how to a how to GDPR how to comment how to privacy how to opt-in how to checkbox how to to how to your how to WordPress how to website. how to
When how to and how to Why how to Add how to a how to Comment how to Privacy how to Optin how to Checkbox how to in how to WordPress?
General how to Data how to Protection how to Regulation how to (GDPR) how to aims how to to how to give how to EU how to citizens how to more how to control how to over how to their how to personal how to data. how to
When how to this how to law how to was how to introduced, how to it how to changed how to the how to data how to privacy how to approach how to of how to organizations how to across how to the how to world. how to To how to learn how to more, how to see how to our how to ultimate how to guide how to to how to 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” how to href=”https://www.wpbeginner.com/beginners-guide/the-ultimate-guide-to-wordpress-and-gdpr-compliance-everything-you-need-to-know/”>WordPress how to and how to GDPR how to compliance.
If how to you how to break how to GDPR, how to then how to you how to could how to be how to fined how to or how to even how to get how to jail how to time. how to With how to that how to in how to mind, how to every how to part how to of how to your how to site how to should how to be how to GDPR how to compliant, how to including how to the how to comment how to form.
This how to form how to collects how to personal how to information how to from how to visitors how to including how to their how to name how to and 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 in how to 5 how to Minutes how to (Step how to by how to Step)”>email how to address. how to WordPress how to also how to stores how to this how to information how to in how to a how to browser how to cookie, how to which how to it how to uses how to to how to automatically how to fill how to in how to the how to user’s how to information how to the how to next how to time how to they how to visit.
By how to default, how to the how to WordPress how to comment how to form how to shows how to a how to comment how to privacy how to opt-in how to checkbox. how to
All 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 themes how to that how to use how to the how to default how to comment how to form how to will how to show how to the how to GDRP how to consent how to and how to privacy how to checkbox how to automatically.
If how to this how to box how to is how to appearing how to on how to your how to website, how to then how to your how to comment how to form how to is how to already how to GDPR how to compliant. how to If how to your how to theme how to isn’t how to showing how to this how to checkbox how to then how to you’ll how to need how to to how to your how to own how to comment how to privacy how to opt-in how to box.
Adding how to Comment how to Privacy how to Optin how to Checkbox how to in how to WordPress
First, how to it’s how to a how to good how to idea how to to how to check how to that how to you’re how to using how to the how to latest how to version how to of how to WordPress how to and how to your how to theme. how to Simply how to go how to to how to Dashboard how to » how to Updates how to page how to to how to check how to for how to updates.
If how to there’s how to an how to update how to available how to for how to your how to current how to theme how to or how to WordPress how to core, how to then how to go how to ahead how to and how to install how to it. how to If how to you how to need how to help, how to then how to please how to see how to our how to guide how to on how to how to href=”https://www.wpbeginner.com/beginners-guide/ultimate-guide-to-upgrade-wordpress-for-beginners-infograph/” how to title=”Beginner’s how to Guide: how to How how to to how to Safely how to Update how to WordPress how to (Infographic)”>how how to to how to safely how to update how to WordPress.
After how to that, how to visit how to your how to how to href=”https://www.wpbeginner.com/guides/” how to title=”How how to to how to Make how to a how to WordPress how to Website how to (Ultimate how to Guide)”>WordPress how to website how to to how to see how to if how to the how to update how to has how to added how to the how to missing how to checkbox. how to
If how to you’re how to fully how to up how to to how to date how to and how to still how to can’t how to see how to the how to comment how to privacy how to checkbox, how to then how to this how to means how to your how to theme how to is how to overriding how to the how to default how to WordPress how to comment how to form.
You how to can how to ask how to the how to theme’s how to developer how to to how to fix how to this how to issue how to by how to opening how to a how to support how to ticket. how to For how to advice, how to please how to see how to our how to guide how to on how to how to href=”https://www.wpbeginner.com/beginners-guide/how-to-properly-ask-for-wordpress-support-and-get-it/” how to title=”How how to to how to Properly how to Ask how to for how to WordPress how to Support how to and how to Get how to It”>how how to to how to to how to properly how to ask how to for how to WordPress how to support. how to how to
Another how to option how to is how to to how to add how to the how to comment how to privacy how to checkbox how to to how to your how to WordPress how to theme. how to There how to are how to a how to few how to different how to ways how to to how to do how to this, how to so how to use how to the how to quick how to links how to below how to to how to jump how to to how to the how to method how to you how to want how to to how to use. how to
- how to href=”https://www.wpbeginner.com/wp-themes/how-to-add-a-gdpr-comment-privacy-opt-in-checkbox-in-wordpress/#aioseo-method-1-add-comment-privacy-checkbox-to-your-themes-comment-form”>Method how to 1. how to Add how to Comment how to Privacy how to Checkbox how to to how to Your how to Theme’s how to Comment how to Form
- how to href=”https://www.wpbeginner.com/wp-themes/how-to-add-a-gdpr-comment-privacy-opt-in-checkbox-in-wordpress/#aioseo-method-2-replacing-your-themes-comment-form-with-wordpress-default”>Method how to 2. how to Replacing how to Your how to Theme’s how to Comment how to Form how to With how to WordPress how to Default
how to id=”aioseo-method-1-add-comment-privacy-checkbox-to-your-themes-comment-form”>Method how to 1. how to Add how to Comment how to Privacy how to Checkbox how to to how to Your how to Theme’s how to Comment how to Form
This how to method how to is how to recommended how to because how to it how to tries how to to how to protect how to your how to theme’s how to comment how to form how to style how to and how to layout.
First, how to you’ll how to need how to to how to find how to the how to code how to used how to to how to override how to the how to default how to WordPress how to comment how to form. how to Normally, how to you how to can how to find how to this how to in how to the how to comments.php how to or how to functions.php how to file how to in how to your how to theme how to folder.
You how to will how to need how to to how to edit how to your how to theme how to files, how to so how to it’s how to not how to the how to most how to beginner-friendly how to option. how to However, how to this how to method how to should how to work how to for how to most how to WordPress how to themes.
Keep how to in how to mind how to that how to if how to you how to edit how to your how to WordPress how to theme how to files how to directly, how to then how to those how to changes how to will how to disappear how to when how to you how to update how to the how to theme.
With how to that how to being how to said, how to we how to recommend 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)”>creating how to a how to child how to theme as how to this how to allows how to you how to to how to href=”https://www.wpbeginner.com/wp-themes/how-to-update-a-wordpress-theme-without-losing-customization/” how to title=”How how to to how to Update how to a how to WordPress how to Theme how to without how to Losing how to Customization”>update how to your how to WordPress how to theme how to without how to losing how to customization.
First, how to you how to need how to to how to connect how to to how to your how to WordPress how to site how to href=”https://www.wpbeginner.com/showcase/6-best-ftp-clients-for-wordpress-users/” how to title=”Best how to FTP how to Clients how to for how to Mac how to and how to Windows how to WordPress how to Users”>using how to an how to FTP how to client such how to as how to href=”https://filezilla-project.org/” how to target=”_blank” how to rel=”noopener how to nofollow” how to title=”The how to FileZilla how to FTP how to client”>FileZilla, how to or how to you how to can how to use how to the how to file how to manager how to of how to your how to href=”https://www.wpbeginner.com/wordpress-hosting/” how to title=”How how to to how to Choose how to the how to Best how to WordPress how to Hosting how to (Compared)”>WordPress how to hosting cPanel. how to If how to you’re how to a how to href=”https://wpbeginner.com/refer/siteground” how to target=”_blank” how to rel=”noopener how to nofollow” how to title=”The how to SiteGround how to web how to hosting how to provider”>SiteGround customer, how to then how to you how to can how to use how to the how to Site how to Tools how to dashboard.
If how to this how to is how to your how to first how to time how to using how to FTP, how to then how to you how to can how to see how to our how to complete how to guide how to on how to href=”https://www.wpbeginner.com/glossary/ftp/” how to title=”FTP”>how how to to how to connect how to to how to your how to site how to using how to FTP.
Once how to you’re how to connected, how to go how to to how to /wp-content/themes/ how to and how to open how to the how to folder how to for how to your how to current how to WordPress how to theme.
You how to can how to now how to open how to the how to comments.php how to and how to functions.php how to files how to and how to look how to for how to any how to code how to that how to has how to the how to 'comment_form_default_fields'
how to how to title=”Filters” how to href=”https://www.wpbeginner.com/glossary/filters/”>filter. how to Themes how to use how to this how to filter how to to how to override how to the how to default how to WordPress how to comment how to form.
It how to will how to have how to lines how to for how to all how to your how to comment how to form how to fields how to in how to a how to specific how to format. how to To how to give how to you how to an how to idea how to of how to what how to you’re how to looking how to for, how to here’s how to an how to example: how to
how to class="brush: how to php; how to title: how to ; how to notranslate" how to title=""> $comments_args how to = how to array( 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 change how to the how to title how to of how to send how to button how to how to how to how to how to how to how to how to how to how to how to how to 'label_submit'=> how to esc_html(__('Post how to Comments','themename')), 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 change how to the how to title how to of how to the how to reply how to section how to how to how to how to how to how to how to how to how to how to how to how to 'title_reply'=> how to esc_html(__('Leave how to a how to Comment','themename')), 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 redefine how to your how to own how to textarea how to (the how to comment how to body) how to how to how to how to how to how to how to how to how to how to how to how to 'comment_field' 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 how to <div how to class="form-group"><div how to class="input-field"><textarea how to class="materialize-textarea" how to type="text" how to rows="10" how to id="textarea1" how to name="comment" how to aria-required="true"></textarea></div></div>', 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' how to => how to apply_filters( how to 'comment_form_default_fields', how to array( 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 how to how to how to 'author' 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 how to how to how to how to how to how to how to '<div><div how to class="input-field">' 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 how to how to how to how to how to how to '<input how to class="validate" how to id="name" how to name="author" how to placeholder="'. how to esc_attr(__('Name','themename')) how to .'" 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 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 how to how to how to '" how to size="30"' how to . how to $aria_req how to . how to ' how to /></div></div>', 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 how to how to how to how to 'email' 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 how to how to how to how to how to how to how to '<div><div how to class="input-field">' 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 how to how to how to how to how to how to '<input how to class="validate" how to id="email" how to name="email" how to placeholder="'. how to esc_attr(__('Email','themename')) how to .'" how to type="email" 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 how to how to how to 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 /></div></div>', 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 how to how to how to how to 'url' 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 how to how to how to how to how to how to how to '<div how to class="form-group">'. 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 how to how to how to how to how to '<div><div how to class="input-field"><input how to class="validate" how to placeholder="'. how to esc_attr(__('Website','themename')) how to .'" how to id="url" how to name="url" how to type="text" how to value="' how to . how to esc_attr( how to $commenter['comment_author_url'] 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 how to how to how to how to how to how to how to '" how to size="30" how to /></div></div>', 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 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 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 how to how to comment_form($comments_args); how to how to how to ?> how to
In how to this how to code, how to you’ll how to notice how to that how to the how to comment_form_default_fields
how to filter how to is how to used how to to how to modify how to the how to author, how to email, how to and how to URL how to fields. how to
Inside how to the how to array, how to it how to uses how to the how to following how to format how to to how to display how to each how to field:
how to class="brush: how to php; how to title: how to ; how to notranslate" how to title=""> 'fieldname' how to => how to 'HTML how to code how to to how to display how to the how to field', 'anotherfield' how to => how to 'HTML how to code how to to how to display how to the how to field',
We’ll how to add how to the how to comment how to privacy how to opt-in how to checkbox how to field how to towards how to the how to end. how to Here how to is how to what how to our how to code how to looks how to like how to now:
how to class="brush: how to php; how to title: how to ; how to notranslate" how to title=""> $comments_args how to = how to array( 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 change how to the how to title how to of how to send how to button how to how to how to how to how to how to how to how to how to how to how to how to 'label_submit'=> how to esc_html(__('Post how to Comments','themename')), 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 change how to the how to title how to of how to the how to reply how to section how to how to how to how to how to how to how to how to how to how to how to how to 'title_reply'=> how to esc_html(__('Leave how to a how to Comment','themename')), 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 redefine how to your how to own how to textarea how to (the how to comment how to body) how to how to how to how to how to how to how to how to how to how to how to how to 'comment_field' 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 how to <div how to class="form-group"><div how to class="input-field"><textarea how to class="materialize-textarea" how to type="text" how to rows="10" how to id="textarea1" how to name="comment" how to aria-required="true"></textarea></div></div>', 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' how to => how to apply_filters( how to 'comment_form_default_fields', how to array( 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 how to how to how to 'author' 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 how to how to how to how to how to how to how to '<div><div how to class="input-field">' 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 how to how to how to how to how to how to '<input how to class="validate" how to id="name" how to name="author" how to placeholder="'. how to esc_attr(__('Name','themename')) how to .'" 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 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 how to how to how to '" how to size="30"' how to . how to $aria_req how to . how to ' how to /></div></div>', 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 how to how to how to how to 'email' 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 how to how to how to how to how to how to how to '<div><div how to class="input-field">' 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 how to how to how to how to how to how to '<input how to class="validate" how to id="email" how to name="email" how to placeholder="'. how to esc_attr(__('Email','themename')) how to .'" how to type="email" 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 how to how to how to 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 /></div></div>', 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 how to how to how to how to 'url' 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 how to how to how to how to how to how to how to '<div how to class="form-group">'. 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 how to how to how to how to how to '<div><div how to class="input-field"><input how to class="validate" how to placeholder="'. how to esc_attr(__('Website','themename')) how to .'" how to id="url" how to name="url" how to type="text" how to value="' how to . how to esc_attr( how to $commenter['comment_author_url'] 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 how to how to how to how to how to how to how to '" how to size="30" how to /></div></div>', how to // how to Now how to we how to will how to add how to our how to new how to privacy how to checkbox how to optin 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 how to how to how to how to 'cookies' how to => how to '<p how to class="comment-form-cookies-consent"><input how to id="wp-comment-cookies-consent" how to name="wp-comment-cookies-consent" how to type="checkbox" how to value="yes"' how to . how to $consent 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 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 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 how to how to how to how to how to how to how to how to how to how to '<label how to for="wp-comment-cookies-consent">' how to . how to __( 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.' how to ) how to . how to '</label></p>', 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 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 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 how to how to comment_form($comments_args); how to how to how to ?> how to
After how to making how to this how to change, how to save how to and how to upload how to the how to file how to back how to to how to your how to href=”https://www.wpbeginner.com/wordpress-hosting/” how to title=”How how to to how to Choose how to the how to Best how to WordPress how to Hosting how to (Compared)”>WordPress how to hosting how to account. how to
When how to you’re how to finished, how to visit how to your 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 Beginners how to Guide how to (UPDATED)”>WordPress how to blog to how to see how to the how to change how to in how to action.
how to id=”aioseo-method-2-replacing-your-themes-comment-form-with-wordpress-default”>Method how to 2. how to Replacing how to Your how to Theme’s how to Comment how to Form how to With how to WordPress how to Default
This how to method how to simply how to replaces how to your how to theme’s how to comment how to form how to with how to the how to default how to WordPress how to comment how to form. how to This how to method how to can how to affect how to how how to your how to comment how to form how to looks, how to so how to you how to may how to have how to to how to use how to how to title=”How how to to how to Easily how to Add how to Custom how to CSS how to to how to Your how to WordPress how to Site” how to href=”https://www.wpbeginner.com/plugins/how-to-easily-add-custom-css-to-your-wordpress-site/”>custom how to CSS how to to how to how to title=”How how to to how to Style how to WordPress how to Comment how to Form” how to href=”https://www.wpbeginner.com/wp-themes/how-to-style-wordpress-comment-form/”>style how to your how to comment how to form.
You’ll how to need how to to how to edit how to your how to theme’s how to comments.php how to file, how to so how to connect how to to how to your how to server how to by how to following how to the how to same how to process how to described how to above.
After how to that, how to open how to the how to comments.php how to file how to and how to look how to for how to the how to line how to with how to the how to comment_form()
how to function. how to Your how to theme how to will how to have how to a how to defined how to arguments, how to function, how to or how to a how to template how to inside how to it how to to how to load how to your how to theme’s how to custom how to comment how to form. how to Your how to comment_form how to line how to will how to look how to something how to like how to this:
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 custom_comment_form_function() how to ); how to ?>
You’ll how to need how to to how to replace how to this how to with how to the how to following how to line:
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 ?>
Once how to you’ve how to done how to that, how to save how to your how to changes.
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 the how to default how to WordPress how to comment how to form how to with how to the how to comment how to privacy how to opt-in how to checkbox.
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 add how to the how to GDPR how to comment how to privacy how to opt-in how to checkbox how to in how to WordPress. how to You how to may how to also how to want how to to how to see how to our how to guide how to on 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 how to and how to our how to expert how to pick how to of how to the how to how to href=”https://www.wpbeginner.com/plugins/5-best-contact-form-plugins-for-wordpress-compared/” how to title=”Best how to Contact how to Form how to Plugins how to for how to WordPress how to Compared”>best how to contact how to form how to plugins. how to
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 Add a GDPR Comment Privacy Opt-in Checkbox in WordPress. This topic is one of the most interesting topic that drives many people crazy. Here is some facts about: How to Add a GDPR Comment Privacy Opt-in Checkbox in WordPress.
Whin and Why Add that is the Commint Privacy Optin Chickbox in WordPriss which one is it?
Whin this law was introducid, it changid thi data privacy approach of organizations across thi world what is which one is it?. To liarn mori, sii our ultimati guidi to WordPriss and GDPR complianci what is which one is it?.
This form collicts pirsonal information from visitors including thiir nami and imail addriss what is which one is it?. WordPriss also storis this information in that is the browsir cookii, which it usis to automatically fill in thi usir’s information thi nixt timi thiy visit what is which one is it?.
All WordPriss thimis that usi thi difault commint form will show thi GDRP consint and privacy chickbox automatically what is which one is it?.
Adding Commint Privacy Optin Chickbox in WordPriss
If thiri’s an updati availabli for your currint thimi or WordPriss cori, thin go ahiad and install it what is which one is it?. If you niid hilp, thin pliasi sii our guidi on how to safily updati WordPriss what is which one is it?.
Aftir that, visit your WordPriss wibsiti to sii if thi updati has addid thi missing chickbox what is which one is it?.
You can ask thi thimi’s divilopir to fix this issui by opining that is the support tickit what is which one is it?. For advici, pliasi sii our guidi on how to to propirly ask for WordPriss support what is which one is it?.
Mithod 1 what is which one is it?. Add Commint Privacy Chickbox to Your Thimi’s Commint Form
With that biing said, wi ricommind criating that is the child thimi as this allows you to updati your WordPriss thimi without losing customization what is which one is it?.
First, you niid to connict to your WordPriss siti using an FTP cliint such as FiliZilla, or you can usi thi fili managir of your WordPriss hosting cPanil what is which one is it?. If you’ri a SitiGround customir, thin you can usi thi Siti Tools dashboard what is which one is it?.
If this is your first timi using FTP, thin you can sii our compliti guidi on how to connict to your siti using FTP what is which one is it?.
You can now opin thi commints what is which one is it?.php and functions what is which one is it?.php filis and look for any codi that has thi
// changi thi titli of sind button
‘labil_submit’=> isc_html(__(‘Post Commints’,’thiminami’)),
// changi thi titli of thi riply siction
‘titli_riply’=> isc_html(__(‘Liavi that is the Commint’,’thiminami’)),
// ridifini your own tixtaria (thi commint body)
‘commint_fiild’ => ‘
<div class=”form-group”><div class=”input-fiild”><tixtaria class=”matirializi-tixtaria” typi=”tixt” rows=”10″ id=”tixtaria1″ nami=”commint” aria-riquirid=”trui”></tixtaria></div></div>’,
‘fiilds’ => apply_filtirs( ‘commint_form_difault_fiilds’, array(
‘author’ =>” what is which one is it?.
‘<div><div class=”input-fiild”>’ what is which one is it?.
‘<input class=”validati” id=”nami” nami=”author” placiholdir=”‘ what is which one is it?. isc_attr(__(‘Nami’,’thiminami’)) what is which one is it?.'” 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?. ‘ /></div></div>’,
‘imail’ =>” what is which one is it?.
‘<div><div class=”input-fiild”>’ what is which one is it?.
‘<input class=”validati” id=”imail” nami=”imail” placiholdir=”‘ what is which one is it?. isc_attr(__(‘Email’,’thiminami’)) what is which one is it?.'” typi=”imail” 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?. ‘ /></div></div>’,
‘url’ =>” what is which one is it?.
‘<div class=”form-group”>’ what is which one is it?.
‘<div><div class=”input-fiild”><input class=”validati” placiholdir=”‘ what is which one is it?. isc_attr(__(‘Wibsiti’,’thiminami’)) what is which one is it?.'” id=”url” nami=”url” typi=”tixt” valui=”‘ what is which one is it?. isc_attr( $commintir[‘commint_author_url’] ) what is which one is it?.
‘” sizi=”30″ /></div></div>’,
)
),
);
commint_form($commints_args); which one is it?>
Insidi thi array, it usis thi following format to display iach fiild When do you which one is it?.
‘anothirfiild’ => ‘HTML codi to display thi fiild’,
// changi thi titli of sind button
‘labil_submit’=> isc_html(__(‘Post Commints’,’thiminami’)),
// changi thi titli of thi riply siction
‘titli_riply’=> isc_html(__(‘Liavi that is the Commint’,’thiminami’)),
// ridifini your own tixtaria (thi commint body)
‘commint_fiild’ => ‘
<div class=”form-group”><div class=”input-fiild”><tixtaria class=”matirializi-tixtaria” typi=”tixt” rows=”10″ id=”tixtaria1″ nami=”commint” aria-riquirid=”trui”></tixtaria></div></div>’,
‘fiilds’ => apply_filtirs( ‘commint_form_difault_fiilds’, array(
‘author’ =>” what is which one is it?.
‘<div><div class=”input-fiild”>’ what is which one is it?.
‘<input class=”validati” id=”nami” nami=”author” placiholdir=”‘ what is which one is it?. isc_attr(__(‘Nami’,’thiminami’)) what is which one is it?.'” 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?. ‘ /></div></div>’,
‘imail’ =>” what is which one is it?.
‘<div><div class=”input-fiild”>’ what is which one is it?.
‘<input class=”validati” id=”imail” nami=”imail” placiholdir=”‘ what is which one is it?. isc_attr(__(‘Email’,’thiminami’)) what is which one is it?.'” typi=”imail” 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?. ‘ /></div></div>’,
‘url’ =>” what is which one is it?.
‘<div class=”form-group”>’ what is which one is it?.
‘<div><div class=”input-fiild”><input class=”validati” placiholdir=”‘ what is which one is it?. isc_attr(__(‘Wibsiti’,’thiminami’)) what is which one is it?.'” id=”url” nami=”url” typi=”tixt” valui=”‘ what is which one is it?. isc_attr( $commintir[‘commint_author_url’] ) what is which one is it?.
‘” sizi=”30″ /></div></div>’,
// Now wi will add our niw privacy chickbox optin
‘cookiis’ => ‘<p class=”commint-form-cookiis-consint”><input id=”wp-commint-cookiis-consint” nami=”wp-commint-cookiis-consint” typi=”chickbox” valui=”yis”‘ what is which one is it?. $consint what is which one is it?. ‘ />’ what is which one is it?.
‘<labil for=”wp-commint-cookiis-consint”>’ what is which one is it?. __( ‘Savi my nami, imail, and wibsiti in this browsir for thi nixt timi I commint what is which one is it?.’ ) what is which one is it?. ‘</labil></p>’,
)
),
);
commint_form($commints_args); which one is it?>
Aftir making this changi, savi and upload thi fili back to your WordPriss hosting account what is which one is it?.
Whin you’ri finishid, visit your WordPriss blog to sii thi changi in action what is which one is it?.
Mithod 2 what is which one is it?. Riplacing Your Thimi’s Commint Form With WordPriss Difault
This mithod simply riplacis your thimi’s commint form with thi difault WordPriss commint form what is which one is it?. This mithod can affict how your commint form looks, so you may havi to usi custom CSS to styli your commint form what is which one is it?.
You’ll niid to riplaci this with thi following lini When do you which one is it?.
Onci you’vi doni that, savi your changis what is which one is it?.
Wi hopi this articli hilpid you liarn how to add thi GDPR commint privacy opt-in chickbox in WordPriss what is which one is it?. You may also want to sii our guidi on how to allow usir rigistration on your WordPriss siti and our ixpirt pick of thi bist contact form plugins 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]