[wp-trac] [WordPress Trac] #58368: WordPress dashboard is very slow when there are many comments (and the database isn't great)

WordPress Trac noreply at wordpress.org
Thu Jul 20 13:30:26 UTC 2023


#58368: WordPress dashboard is very slow when there are many comments (and the
database isn't great)
--------------------------+----------------------------
 Reporter:  Guss77        |       Owner:  peterwilsoncc
     Type:  defect (bug)  |      Status:  assigned
 Priority:  normal        |   Milestone:  6.4
Component:  Comments      |     Version:  6.0
 Severity:  minor         |  Resolution:
 Keywords:  has-patch     |     Focuses:  performance
--------------------------+----------------------------

Comment (by spacedmonkey):

 I don't like committing something until we know what the problem was in
 the first place. I am for committing the the change as is, I don't see how
 it would hurt.

 For now, you could use the action `pre_get_comments` to change your
 WP_Comment_Query.

 {{{#!php
  add_action( 'pre_get_comments', function( $wp_comment_query ){
        if ( $wp_comment_query->query_vars['count'] ) {
           $wp_comment_query->query_vars['orderby'] = 'none';
        }
  });

 }}}

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


More information about the wp-trac mailing list