0

Hello good day everyone,

Guys any idea how to hide permalinks from custom post types and should not be able to access via url. By the way, Im using Pods framework for my CPT's

Example: www.example.com/this-is-a-custom-post-type

Any suggestions, recommendation will be appreaciated.

Thanks!

  • Just set the post type to not be public, and it won't be accessible via URL. In code it's done with a 'public' => false argument, but I don't know what the option in Pods looks like. – Jacob Peattie Nov 26 '19 at 6:41
  • Hi @JacobPeattie it still be able to query it via WP_Query? – happy Nov 26 '19 at 6:44
  • Yes, but you wouldn't be able to link to it, because there'd be no URL. – Jacob Peattie Nov 26 '19 at 7:04
  • Thanks @JacobPeattie! – happy Nov 26 '19 at 7:14
1

Welcome!

After creating a post type using pods, You can navigate to Advanced options and uncheck Public and Publicly Queryable.

Note: There are parameters like exclude_from_search, publicly_queryable, show_ui, and show_in_nav_menus that are inheriting value from public. You need to set them manually if you want to use them.

More info: https://developer.wordpress.org/reference/functions/register_post_type/

Advanced options of pod's custom post type

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.