How to Add Accept Privacy Policy Checkbox to PPWP Password Form

You have just protected a page so that only authorized users are allowed to see your private and high quality content.

Besides, it’s very important to you that the visitors read and accept the privacy policy of your private content, especially to avoid any problems regarding collecting IP addresses without previous consent.

Wonder how to set up that simple checkbox for your site?

We know just the simplest way to achieve what you want. Simply put the code below at the end of your (child) theme functions.php

By adding required in checkbox input, everyone who wants to access your protected site must tick the checkbox together with entering their password.

add_action( 'ppwp_ppf_fields_after_password', 'custom_checkbox' );

function custom_checkbox() {

?>

<div>

<input type="checkbox" id="policy" name="policy" value="policy" required>

<label for="policy"> I read and accepted the <a href="https://passwordprotectwp.com/privacy-policy/">privacy policy</a></label>

</div>

<?php

}

Lasted updated on December 28, 2021