WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a custom post type that I'm just using just to keep data in but I sometimes share it with others, and I don't want any confusion when the "view" link appears in the admin column.

Is there a way of removing that?


share|improve this question
up vote 13 down vote accepted
add_filter( 'post_row_actions', 'remove_row_actions', 10, 1 );

function remove_row_actions( $actions )
    if( get_post_type() === 'my_cpt' )
        unset( $actions['view'] );
    return $actions;

Should see you through :)

The $actions array consists of the following:

$actions['inline hide-if-no-js'] 

For future reference.

share|improve this answer
Thanks Wild Phoenix, though it doesn't seem to be working. I add my cpt and the view link still appears. – Marco Apr 21 '11 at 15:05
Sorry I missed the braces on the method get_post_type() try that! – Cristian Apr 21 '11 at 15:25
That did the trick! Awesome help Wild Phoenix. Much appreciated! – Marco Apr 21 '11 at 15:42
Where do I add the code above? – user11680 Jan 4 '12 at 12:24
@Darren You can simply copy paste this code into your functions.php file of your template. Hope that helps! – Cristian Jan 23 '12 at 9:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.