X

Remove Post Columns

Snippets by IsItWP

Are you looking for a way to easily remove columns from the posts and pages? While there’s probably a plugin for this, we have created a quick code snippet that you can use to remove post columns in WordPress. In this case, it will remove the Comments column.

Instructions:

All you have to do is add this code to your theme’s functions.php file or in a site-specific plugin:

function remove_post_columns($defaults) {
  unset($defaults['comments']);
  return $defaults;
}
add_filter('manage_posts_columns', 'remove_post_columns');

Note: If this is your first time adding code snippets in WordPress, then please refer to our guide on how to properly add code snippets in WordPress, so you don’t accidentally break your site.

If you liked this code snippet, please consider checking out our other articles on the site like: 11 best WordPress slider plugins and how to increase maximum file upload size in WordPress.

Comments   Leave a Reply

  1. 20 Snippets and Hacks to Make WordPress User-Friendly for your Clients (part 1) | jQuery4U | No.1 Resource for jQuery Developers April 22, 2014 at 11:37 pm

    […] Similar to the snippet above, this code will remove columns from the posts page. Source […]

  2. 15 Hacks to Pimp Your WordPress Website | Template Monster Blog March 20, 2012 at 6:58 am

    […] "do_googleMaps");* * *Recent Posts With Thumbnails In WordPress Without A Plugin* * *Remove post columns1 2 3 4 5 function remove_post_columns($defaults) { […]

  3. 20 Snippets to Make WordPress User-Friendly (part 1) | jQuery4u October 30, 2011 at 11:22 am

    […] Similar to the snippet above, this code will remove columns from the posts page. Source […]

  4. Thanks for this snippit! I use this on custom post types overviews to remove custom posts column i set for posts with ‘manage_posts_columns’. But isn’t there a better way to set custom columns ONLY for the post overview?

  5. 20 Snippets and Hacks to Make Wordpress User-Friendly for your Clients April 28, 2011 at 3:29 am

    […] return $defaults; } add_filter('manage_posts_columns', 'remove_post_columns');Source →Removing Default Widgets from the DashboardThe majority of the default Dashboard widgets may not be […]

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!