Example 1 — Print the link
The simplest call.
<?php
the_privacy_policy_link(); How It Works
- WordPress finds the page chosen in Settings.
- It prints an
atag with the page title. - The class
privacy-policy-linklets you style it.

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().
Call it where you want the link to appear.
<?php the_privacy_policy_link(); ?> | Call | What 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.
the_privacy_policy_link( string $before = '', string $after = '' ): void | Parameter | Description |
|---|---|
$before | string. HTML printed before the link. Default is empty. |
$after | string. HTML printed after the link. Default is empty. |
| Return Value | Description |
|---|---|
| void | Nothing is returned. The link is printed when a policy page is set. |
Three short examples. Each one shows the code and what it prints or does.
The simplest call.
<?php
the_privacy_policy_link(); a tag with the page title.privacy-policy-link lets you style it.Wrap the link in a paragraph for the footer.
<?php
the_privacy_policy_link( '<p class="footer-links">', '</p>' ); Print text first, then the link.
<?php
echo '© 2026 CodeToFun | ';
the_privacy_policy_link(); echo prints the copyright text.the_privacy_policy_link() adds the link right after it.echo is needed for the link itself.Add or remove the trailing slash of a URL to match your permalink setting.
12 people found this page helpful