Halloween Sale 15% off Ends in See the plans

Snippet Library

Privacy & Cookies snippets for WordPress

Snippets for privacy and cookies: load tracking only after consent, remove IP addresses, tidy personal data and add privacy notices. For site owners working toward GDPR and similar privacy rules.

1–7 of 7 snippets “consent”

  • PHP Privacy & Cookies

    Adds a [do_not_sell_link] shortcode for the opt-out link US state privacy laws such as the CCPA require; clicking it records the visitor's opt-out in a cookie and tells marketing scripts held back by consent snippets not to run.

  • PHP Privacy & Cookies

    Records each cookie consent choice (accepted or rejected, categories, date and privacy policy version) in its own database table, with only a shortened IP address, and lists the latest records under Tools > Consent Log.

  • PHP Privacy & Cookies

    Turns the scripts you list by handle into inactive placeholders and only runs them after the visitor gives consent, through the WP Consent API when a consent plugin provides it or the simple wpide_consent cookie otherwise.

  • PHP Privacy & Cookies

    Site Health Checks for Privacy Settings

    Adds Site Health tests that check whether a privacy policy page is published, whether full commenter IP addresses are being stored, and whether the comment cookie consent checkbox is turned on.

Have a snippet worth sharing?

Publish it to the library from WPIDE or right here. Sign in with any WordPress site that runs WPIDE, free or Pro. Public snippets are reviewed by the WPIDE team before they appear.