Custom post types with no permalinks

When I was at WordCamp Ottawa this year, I was asked a question about how to create custom post types without generating permalinks. This is actually something I do a lot of as I am creating internal content types that are not meant to be viewed individually at their own url.

The snippet below will register the post type and you’ll notice that there is no Permalink line below the title.The only thing left to do is to filter the post updated messages for the post type to remove the view links when you save, publish or update the post!


$args = array(
    'public'    => false,
    'show_ui'   => true,
    'query_var' => false, 
    'rewrite'   => false,
    // add whatever else is needed
register_post_type( 'post_type_name', $args );