Skip Navigation

[Resolved] Set a custom post type page as a WP Privacy Policy

This support ticket is created 4 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

Tagged: 

This topic contains 3 replies, has 2 voices.

Last updated by Jamal 4 years, 4 months ago.

Assisted by: Jamal.

Author
Posts
#1899111

Hi, I've created a custom post type (using Types) for all of my site's legal pages (ToS, Privacy policy, etc.). When I navigate to the WordPress admin "Settings > Privacy" page, none of the custom pages are visible as options in the dropdown form field for linking a site Privacy Policy. I've tried looking through documentation for both Toolset and WP, but I haven't been able to find how to 'expose' custom post types to be visible in that form field. I do know that it is possible to do so, as I have been utilizing a plugin that creates its own custom post type, and is making its own custom posts visible in that form field, but I am trying to pare down the reliance on extraneous plugins. Any light that you could shed on how to achieve this, what post-type settings to use, or documentation that you could point me towards would be extremely helpful.

I am developing locally, so I don't have a URL to share.

#1900235

Hello and thank you for contacting the Toolset support.

I don't know that it is possible in WordPress, by default, to choose other post types than Pages. WordPress offers some hooks to customize the privacy page, but I could not find any hooks to change the dropdown on the settings page.
https://developer.wordpress.org/?s=privacy&post_type%5B%5D=wp-parser-hook

For example privacy_policy_url can let you change the URL of the privacy policy page and provide the URL of your post there.
https://developer.wordpress.org/reference/hooks/privacy_policy_url/

What if you create a new page and use it as the privacy policy page. And inside of it, you can use a view that displays your posts, or you can use multiple content templates to display each post of them. Does it make sense?

I hope this helps. Otherwise, please elaborate more on what you are trying to build? Why would you like your custom posts to appear in the settings instead of pages?

#1903313

Hi Jamal, thank you for getting back to me. I could use a standard WP "page," but my intention with creating a CPT specifically for a certain category of pages is an attempt at better organization. As the site grows, and we add more "standard" pages and more "legal" pages, I was attempting to organize anything that falls into that category into its own post type. It becomes very tedious to sort through pages and pages worth of "pages" within the WP admin.

I mentioned in my initial post that I know for certain that it is definitely possible to add custom posts to that dropdown menu, as a 3rd party plugin I am currently using (and wish to eventually remove) has managed to do it for its own custom posts, but it's just beyond the edge of my comprehension to be able to reverse engineer the solution. I wasn't sure if it was a matter of the settings in my custom post type being incorrect, or if I needed to add some custom code into my functions.php.

#1906251

Thank you, Jonathan, for your feedback. I would suggest continuing using that 3rd plugin if you need to see your custom post type posts in the settings.

But, I would suggest my previous suggestion again. Because we can only choose one item in the setting, I'll suggest that you create one page and assign it there. The page will be empty, but you will be able to control its content using a content template that is assigned only to that page. Then, in the content template, you can control the content. You can put your custom post type posts using content templates or views. Does it make sense to you?