[wp-trac] [WordPress Trac] #64748: Privacy: get_the_privacy_policy_link() should strip HTML tags and return plain text

WordPress Trac noreply at wordpress.org
Fri Feb 27 09:33:31 UTC 2026


#64748: Privacy: get_the_privacy_policy_link() should strip HTML tags and return
plain text
--------------------------+------------------------------
 Reporter:  wildworks     |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Privacy       |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by hbhalodia):

 Hi @wildworks, I attempted to reproduce the issue locally. What I observed
 is that the `< character is already converted to < (and similarly > to
 >)` when stored. Because of this, using `wp_strip_all_tags()` would not
 have any effect, as the database itself contains the encoded entities
 rather than actual HTML tags.

 If I understand the concern correctly, for a title such as `Privacy
 <strong>Policy</strong>`, the expected output would be `Privacy Policy`,
 with the `<strong>` tag removed and only the plain text displayed.

 In order to achieve this, we may first needs to convert back to HTML
 entity and then use `wp_strip_all_tags` function to remove any HTML tags.

 Let me know if I understand the issue correctly?

 Thanks,

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/64748#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list