permalinks - Custom Post Type "MUST NOT" be able to search via URL

Hello good day everyone,Guys any idea how to hide permalinks from custom post types and should not be able to access via

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/this-is-a-custom-post-type

Any suggestions, recommendation will be appreaciated.

Thanks!

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/this-is-a-custom-post-type

Any suggestions, recommendation will be appreaciated.

Thanks!

Share Improve this question asked Nov 26, 2019 at 6:30 happyhappy 31 bronze badge 4
  • 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 Commented Nov 26, 2019 at 6:41
  • Hi @JacobPeattie it still be able to query it via WP_Query? – happy Commented Nov 26, 2019 at 6:44
  • Yes, but you wouldn't be able to link to it, because there'd be no URL. – Jacob Peattie Commented Nov 26, 2019 at 7:04
  • Thanks @JacobPeattie! – happy Commented Nov 26, 2019 at 7:14
Add a comment  | 

1 Answer 1

Reset to default 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/reference/functions/register_post_type/

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744968190a4603810.html

相关推荐

  • permalinks - Custom Post Type "MUST NOT" be able to search via URL

    Hello good day everyone,Guys any idea how to hide permalinks from custom post types and should not be able to access via

    23小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信