How to customise a Privacy Policy Guide

Let me clarify – WordPress 4.9.6 didn’t receive any functionality to change the content of your existing Privacy Policy pages on the fly. And I do not recommend to do it automatically. Well, if you want it so much, the_content() action hook will help you. Maybe 😁

So, what is the new functionality about? First of all a new Privacy submenu item appeared in the Settings menu. You can create or select any existing privacy page and after that its ID will be available in options, get_option( 'wp_page_for_privacy_policy' ).

New Privacy settings page in WordPress 4.9.6

Do you see “Check out our guide” link? This tutorial is all about it. The guide contains the recommended content for your Privacy Policy page, you can copy it the whole, or just some parts and insert to your Privacy Policy page manually. Plugin authors can add their plugin-related sections to the guide with wp_add_privacy_policy_content() function.

Change the default content in the Privacy Policy Guide

WordPress has a lot of default content in this admin section. But sometimes you may want to customize it to meet your custom theme needs.

Here is how to do it.


add_filter( 'wp_get_default_privacy_policy_content', 'misha_custom_privacy_content' );
function misha_custom_privacy_content( $privacy_content ){
	return wpautop('

Who I am

I\'m Misha.

How I collect you data

I don\'t.'); }

Here is what we got after inserting the above code in… let’s say functions.php of your theme.

We can change the WordPress Privacy Policy Guide default content with the filter hook.

And yes, no way to change the Introduction.

Add a section to Privacy Policy Guide

As I already mentioned before, wp_add_privacy_policy_content() function can help you with it. Note, that you have to run it within admin_init action hook and do not forget to make it compatible with WordPress 4.9.5 and lower.


add_action( 'admin_init', 'misha_custom_plugin_privacy_content' );
function misha_custom_plugin_privacy_content() {

	// compatibility with old WordPress versions to avoid error 500
	if ( ! function_exists( 'wp_add_privacy_policy_content' ) ) {
		return;
	}

	wp_add_privacy_policy_content(
		'Plugin by Misha', // section name
		'When you contact us via a contact form, your email will be stored in database for a one week. So we never miss your email!' // content
	);
}

So, once you added it, you could notice, that a notification bubble has been appeared near the Settings Menu.

The privacy notification bubble will appear after any changes in your Privacy Policy Guide.

Go to Settings > Privacy and click "Check out our guide" link.

I wrap the text into wpautop() WP function just to auto-<p> it. And here is what we got.

A custom section in WordPress Privacy Policy Guide

Here is a short video about this functionality as well:

[youtube_embed]https://www.youtube.com/embed/KHgZerh7nKY[/youtube_embed]

If you have any questions, welcome to comments πŸ‘‡

Misha Rudrastyh

Misha Rudrastyh

Hey guys and welcome to my website. For more than 10 years I've been doing my best to share with you some superb WordPress guides and tips for free.

Need some developer help? Contact me

Follow me on X