Halloween Sale 15% off Ends in See the plans
PHP

Add Your Own Section to the Privacy Policy Guide

Adds a suggested paragraph about your custom code (such as analytics, embeds or contact forms) to the Privacy Policy Guide under Settings > Privacy, ready to copy into your policy.

Don’t have WPIDE yet? Install it on your site

Code

// Heading and suggested policy text.
$wpide_policy_name = 'Site customizations';
$wpide_policy_text = '<p>We use privacy-friendly analytics that do not set cookies or store your IP address.</p>'
    . '<p>Embedded videos and maps only load after you click them, so the provider does not receive data before you choose to watch or view.</p>'
    . '<p>Messages sent through our contact form are emailed to us and deleted from our inbox after 12 months.</p>';

add_action( 'admin_init', function () use ( $wpide_policy_name, $wpide_policy_text ) {
    if ( function_exists( 'wp_add_privacy_policy_content' ) ) {
        wp_add_privacy_policy_content( $wpide_policy_name, wp_kses_post( wpautop( $wpide_policy_text, false ) ) );
    }
} );

Notes

Edit the text to describe what your site really collects; the guide only suggests content and does not change your policy page.

How to add this snippet

  1. Install WPIDE on your WordPress site (it is free) and open Code Snippets.
  2. Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
  3. It is added inactive: review the code and settings, then switch it 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.

Which site should get this snippet?

Enter the address of your WordPress site. WPIDE opens there in a new tab with the snippet ready to review and save.

Remembered in this browser only, so you are asked once.

Report this snippet

Tell the WPIDE team what is wrong: broken code, something harmful, spam or copied work.