¿Quieres eliminar la columna de recuento de comentarios de las páginas en el panel de WordPress? Con nuestro snippet, es fácil eliminar la columna de comentarios no deseados de tus páginas. En este artículo, le mostraremos cómo eliminar la columna de comentarios de las páginas en el panel de WordPress.
Instrucciones:
Todo lo que tienes que hacer es añadir este código al archivo functions.php de tu tema o en un plugin específico del sitio:
function remove_pages_count_columns($defaults) { unset($defaults['comments']); return $defaults; } add_filter('manage_pages_columns', 'remove_pages_count_columns');
Nota: Si es la primera vez que añade fragmentos de código en WordPress, consulte nuestra guía sobre cómo copiar / pegar correctamente fragmentos de código en WordPress, para no romper accidentalmente su sitio.
Si te ha gustado este fragmento de código, por favor considere revisar nuestros otros artículos en el sitio como: 62 mejores temas gratuitos para blogs de WordPress o 7 mejores plugins para formularios de contacto de WordPress.
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 […]