Do you want to remove the comments count column from pages in WordPress dashboard? With our snippet, it’s easy to remove the unwanted comments column from your pages. In this article, we’ll show you how to remove the comments column from pages in your WordPress dashboard.
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_pages_count_columns($defaults) { unset($defaults['comments']); return $defaults; } add_filter('manage_pages_columns', 'remove_pages_count_columns');
Note: If this is your first time adding code snippets in WordPress, then please refer to our guide on how to properly copy / paste 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: 62 best free WordPress blog themes or 7 best WordPress contact form plugins.
Kevin, thanks for the share, but i want to edit your original Post. The part of code below absolutely works.
Kevin, thanks for the share but i want to make one small correction to your original Post.
Kevin thanx for this!
I would like to know if I want it to remove more columns on different parts of the admin area (pages, media, posts) how I would do this? Is there a simple example you could share?
– ENIX
The Netherlands
Hi Enix,
Well if you look on line 3 of the code you will see the name ‘comments’ change that to the name of other columns and it will remove them. However you can also remove multiple by just adding more of the same eg:
unset($defaults[‘comments’]);
unset($defaults[‘other’]);
unset($defaults[‘other’]);
I did not test all these names however they should work for you.
cb, title, author, categories, tags, comments, date
@wpsnipp:disqus ,
thank you, after my first reply I tried it as following and this works fine:
function remove_pages_count_columns($defaults) { unset($defaults[‘comments’]); return $defaults;}add_filter(‘manage_pages_columns’, ‘remove_pages_count_columns’);function remove_media_count_columns($defaults) { unset($defaults[‘comments’]); unset($defaults[‘author’]); unset($defaults[‘date’]); return $defaults;}add_filter(‘manage_media_columns’, ‘remove_media_count_columns’);
Again thank you for your work, alot of snippets are very handy! 🙂
No problem anytime, I post new snippets everyday so visit often 🙂
not working for me
[…] a little trick I found over at WPsnipp.com from author Kevin Chard. Add this to your functions.php file and it will remove the comments count […]