WordPress the_privacy_policy_link() Function

Beginner
5 min read
Updated: Nov 2026
3 examples
Prints a link

Definition

In WordPress, the_privacy_policy_link() prints a link to your Privacy Policy page. You choose that page in Settings > Privacy.

Many themes use it in the footer. If no policy page is set, or the page is not published, nothing is printed. To get the link as a value instead, use get_the_privacy_policy_link().

Syntax

Call it where you want the link to appear.

WordPress
<?php the_privacy_policy_link(); ?>
CallWhat it does
the_privacy_policy_link()Print the link.
the_privacy_policy_link( '<p>', '</p>' )Print the link inside a paragraph.
the_privacy_policy_link( '', ' | ' )Print the link followed by a separator.

It prints the link. It does not return it.

Full declaration
WordPress
the_privacy_policy_link( string $before = '', string $after = '' ): void

Parameters

ParameterDescription
$beforestring. HTML printed before the link. Default is empty.
$afterstring. HTML printed after the link. Default is empty.

Return Value

Return ValueDescription
voidNothing is returned. The link is printed when a policy page is set.

WordPress Examples

Three short examples. Each one shows the code and what it prints or does.

Example 1 — Print the link

The simplest call.

WordPress
<?php
the_privacy_policy_link();

How It Works

  1. WordPress finds the page chosen in Settings.
  2. It prints an a tag with the page title.
  3. The class privacy-policy-link lets you style it.

Frequently Asked Questions

It prints a link to your site's Privacy Policy page.
Go to Settings, then Privacy, pick a page, and publish it.
No policy page is selected, or the page is not published.
the_privacy_policy_link() prints the link. get_the_privacy_policy_link() returns it.
Most themes use it in the footer, near the copyright text.

Next: user_trailingslashit()

Add or remove the trailing slash of a URL to match your permalink setting.

user_trailingslashit() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

12 people found this page helpful