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?
Asked
Active
Viewed 8,183 times
2 Answers
14
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
.

Burgi
- 421
- 8
- 24

Ritesh Ksheersagar
- 542
- 7
- 22
-
In some case we need to keep custom post type public as true – Feb 24 '15 at 14:17
-
I agree, but according to the question, this is the right way to actually hide the permalink. It really depends on what and how you want to implement in WP – Ritesh Ksheersagar Feb 25 '15 at 13:02
-
1Original answer here: https://wordpress.stackexchange.com/a/108658/62753 – Burgi Jan 16 '18 at 12:19
0
It's possible by adding the value 'permalink' to the 'hide_on_screen' array of ACF (Advanced Custom Fields). Or doing this via the ACF Field group configurator.
'hide_on_screen' => array(
0 => 'the_content',
1 => 'excerpt',
2 => 'custom_fields',
3 => 'discussion',
4 => 'comments',
5 => 'revisions',
6 => 'slug',
7 => 'author',
8 => 'format',
9 => 'categories',
10 => 'tags',
11 => 'send-trackbacks',
12 => 'permalink',
),

Colin Duet
- 1
- 1