Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide Permalink section from a Custom Post Type's post?

I want to hide the permalink section under the title of a post for a particular post type in Wordpress. How can I do that?

like image 849
user3132101 Avatar asked Oct 14 '25 16:10

user3132101


1 Answers

Under register_post_types add the following arguments:

'public' => false,  // it's not public, it shouldn't have it's own permalink, and so on
'publicly_queryable' => true,  // you should be able to query it
'show_ui' => true,  // you should be able to edit it in wp-admin
'exclude_from_search' => true,  // you should exclude it from search results
'show_in_nav_menus' => false,  // you shouldn't be able to add it to menus
'has_archive' => false,  // it shouldn't have archive page
'rewrite' => false,  // it shouldn't have rewrite rules

What you need is the first element 'public' => false.

like image 199
Ritesh Ksheersagar Avatar answered Oct 18 '25 05:10

Ritesh Ksheersagar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!