Recommended Free Tools
Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
To display your most-commented WordPress posts, sort a post list by its total comment count in descending order. For precise control, use a WP_Query with orderby set to comment_count; block-editor and shortcode options may also work, depending on your setup. This ranks lifetime totals by default—not posts with the most activity this week or month.
Choose the method that fits your site
| Method | Best fit | Control and upkeep |
|---|---|---|
Custom WP_Query |
A developer or site maintainer adding a ranked list to a theme or template | Explicit control over sorting and comment-count filters; requires code and template maintenance. WordPress documents the query options. |
| Query Loop and editor blocks | A block-theme or editor layout where the available query controls provide the needed order | Can avoid custom PHP, but the available ordering controls vary by WordPress version and editor configuration. The Comments Count block documentation explains its display and context. |
| Display Posts Shortcode | A site where a shortcode is convenient and the plugin is suitable for its WordPress setup | Less custom code, with a plugin dependency. Check the current listing for maintenance and compatibility before installing. The plugin listing documents its shortcode options. |
Use a custom query for a ranked post list
WordPress’s WP_Query supports sorting by comment count. Setting descending order places posts with higher counts first. The query reference shows comment_count as a popularity ordering: WP_Query reference.
For example, add a query like this in a theme template or other appropriate PHP location:
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →<?php
$popular_posts = new WP_Query( array(
'post_type' => 'post',
'post_status' => 'publish',
'posts_per_page' => 5,
'orderby' => 'comment_count',
'order' => 'DESC',
) );
if ( $popular_posts->have_posts() ) {
echo '<ul>';
while ( $popular_posts->have_posts() ) {
$popular_posts->the_post();
echo '<li>';
echo '<a href="' . esc_url( get_permalink() ) . '">';
echo esc_html( get_the_title() );
echo '</a> (' . absint( get_comments_number() ) . ')';
echo '</li>';
}
echo '</ul>';
}
wp_reset_postdata();
?>
This example lists five published standard posts and shows each post’s comment count. Change posts_per_page to set the list length. To include a custom post type, set post_type to the type you want or to an appropriate array of types rather than assuming the default post type covers it.
If you add a second query inside a template, restore the global post data afterward with wp_reset_postdata(). The example does so after rendering the list.
Filter out posts with few or no comments
The comment_count query argument can filter for an exact count or use a comparison operator. For example, add this argument to the query to include posts with at least 25 comments:
Rank #2
'comment_count' => array(
'value' => 25,
'compare' => '>=',
),
WordPress documents the supported comment-count comparisons in the WP_Query reference. A threshold is useful when a short list should contain only posts with a minimum level of discussion; it is separate from the descending sort.
Build the list with the block editor
A Query Loop can provide a list of posts in a block-editor layout. If your installed WordPress version and editor configuration offer comment-count ordering in the Query Loop’s query controls, use those controls to sort the results. The available documentation confirms that the Comments Count block displays the total for its current post, but does not establish that every Query Loop exposes comment-count ordering. Check the controls in your own editor before relying on this as a no-code ranking method.
To show each listed post’s count, place a Comments Count block within the Query Loop’s Post Template, alongside the title or other post details. On a non-singular page, the block needs the post context provided by that template; it displays a count, but does not rank posts by itself. See the Comments Count block documentation.
Use the Display Posts Shortcode plugin
The Display Posts Shortcode plugin documents this shortcode for ordering a list by comment count:
Rank #4
[display-posts orderby="comment_count"]
Use it only after checking the plugin’s current maintenance, compatibility information, and supported options for your WordPress installation. The plugin listing documents the ordering option, but that alone does not establish compatibility with every site or configuration. The shortcode’s other parameters and placement options depend on what the plugin supports.
Most-commented posts are not the same as recent comments
Sorting by comment_count uses each post’s total comment count. It does not automatically limit the ranking to a recent period. To rank posts by comments received this week or month, the implementation needs a separate date-window rule; the basic query and shortcode options above do not create one.
Best Value
The Latest Comments block serves a different purpose: it lists recent individual comments and their associated users and posts. It is not a ranking of posts by their total discussion count. See the Latest Comments block documentation.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

