By default, the user registration for WordPress is off. Once you enable it, you’ll find it doesn’t let you gather much information from users when they first register on your site. It has basic fields, including Username or Email Address and Password.
Custom fields empower you to get extra information from your users, such as an address or phone number, or ask them to accept your Terms & Conditions, Privacy Policy, etc.
Important: The WordPress Checkboxes or checkboxes at any website are legal, as clicking on a checkbox is urging a signature on a written contract.
Here we’ll explain how to add the custom field “Privacy Policy” in the WordPress registration form with custom coding. So, make sure you read this article till the end.
Let’s get started!
Enable WordPress Registration Form
Note: We assume you’ve already enabled the WordPress registration form.
If not, simply go to the left sidebar of the admin dashboard, navigate to Settings, and click the General option.
The General Settings screen will open up. Scroll down a bit, and tick mark the Membership checkbox.
When you are done, scroll done and click on the Save Changes button to save the settings.
Now you can see the registration link on your login page:
Adding Custom Field “Privacy Policy” on the Registration Form
Here are going to add the custom “Privacy Policy” checkbox to the user registration form in WordPress. This process will be carried out using custom coding, so buckle up!
1. Hook for Adding Privacy Policy Field on the Registration Form
Note: register_form Allow rendering of new HTML element.
Paste the following code in the child theme’s functions.php file to add the Privacy Policy checkbox on the registration form.