[wp-trac] [WordPress Trac] #46243: WordPress Comments Core Query

WordPress Trac noreply at wordpress.org
Mon Jun 30 10:48:29 UTC 2025


#46243: WordPress Comments Core Query
--------------------------+------------------------------
 Reporter:  Uranbold      |       Owner:  (none)
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Comments      |     Version:  5.0.3
 Severity:  normal        |  Resolution:  wontfix
 Keywords:  dev-feedback  |     Focuses:
--------------------------+------------------------------
Changes (by callumbw95):

 * status:  new => closed
 * resolution:   => wontfix


Comment:

 Hi All,

 Just took a look at this, and tested @donmhico's solution and can confirm
 that this works. Additionally to this I have written an extra filter to
 remove the comments button from the header entirely too as the
 aforementioned filter stops the comment counter from working.
 To do this I have added the following filter:
 {{{#!php
 <?php
 function remove_comments_count_from_wp_admin_bar()
 {
         global $wp_admin_bar;
         $wp_admin_bar->remove_menu('comments');
 }
 add_action('wp_before_admin_bar_render',
 'remove_comments_count_from_wp_admin_bar');
 }}}
 You will still need @donmhico's filter included to stop the SQL still, but
 this additional filter is just a bit of polish if you didn't want the
 button to show in the admin bar.

 Also, seeing as this ticket hasn't had any activity in the last 4 years, I
 am going to mark this ticket as closed. But for future reference as this
 doesn't specifically mention an issue or something within core WordPress,
 I would recommend submitting any site specific issues at the
 [https://wordpress.org/support/welcome/" WordPress Support Forum], as you
 are more likely to get a quicker reply there for non core related issue.

 Hope this helps 😃

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/46243#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list