I have created a custom post type, but it just to list some data on a page and it doesn’t have any single.php.

How do i disable so on the post page when i click publish it doesn’t show the “View Page” link and also how do i disable the “View” link in the columns for that post type.

Thanks

2 Answers
2

Changing the public argument of register_post_type() will remove the link to view your custom post type publicly.

'public' => false, 

See: WordPress Codex

Note that this will also hide your custom post type from the admin navigation menus, which you might not want. To hide the ‘View Post’ link but keep your post type in the admin menus use show_ui as well like so:

'public'  => false,
'show_ui' => true,

Leave a Reply

Your email address will not be published. Required fields are marked *