[agentsw ua=’pc’]
Do you want to display the most recent comments first in WordPress?
By default, WordPress displays older comments first. However, you may want to change this so the most recent comments appear on top.
In this article, we’ll show you how to easily rearrange comments in WordPress and display the most recent comments first.
Why Display the Most Recent Comments First in WordPress
By default, WordPress shows comments in the order they’re posted, so the oldest comments appear first. This means the post’s oldest comment is the first thing visitors see.
Many site owners use comments to boost user engagement and showing outdated comments isn’t the best way to spark a new conversation. By displaying the most recent comments first, you can encourage visitors to join the discussion and keep the conversation going. This is a great way to get more comments on your WordPress blog.
Prominently showing the most recent comments can also make your site look more fresh, lively, and engaging. This can increase pageviews and and reduce bounce rate in WordPress.
That being said, let’s see how you can easily display the most recent comments first in WordPress. Simply use the quick below to jump to the method you want to use.
1. Display Newer Comments First in WordPress Settings
The easiest way to rearrange your comments is by heading over to Settings » Discussion in your WordPress dashboard.
In the other ‘Other comment settings’ section, find ‘Comments should be displayed with…’
This is set to ‘older comments at the top of each page’ by default, but you can open this dropdown and choose ‘newer’ instead.
Once you’ve done that, just scroll to the bottom of the page and click on ‘Save Changes’ to store your settings.
Now if you visit any page or post, you’ll see the newest comments first.
2. Manually Set Comment Display Order in WordPress
The first method is the easiest, but there are some scenarios where the WordPress settings may not work.
For example, you might have created a custom WordPress theme, or you may be working on a multi-author WordPress blog and don’t have permission to access the settings page.
In that case, you can show the newest comments first by adding code to your WordPress website. Normally, you would need to add custom code snippets to your theme’s functions.php file.
However, we don’t recommend this method as even a small mistake in your code could cause a number of common WordPress errors, or break your site completely.
That’s why we recommend using WPCode. It is the easiest and safest way to add code snippets in WordPress without having to edit any core WordPress files.
The first thing you need to do is install and activate the free WPCode plugin on your website. For more details, please see our step-by-step guide on how to install a WordPress plugin.
Upon activation, go to Code Snippets » Add Snippet in your WordPress dashboard.
Here, you’ll see all of the different ready-made snippets that you can add to your site. This includes a snippet that allows you to completely disable comments and disable the WordPress admin bar.
Since we want to add our own snippet, hover your mouse over ‘Add Your Custom Code,’ and then click ‘Use snippet.’
To start, enter a title for the custom snippet. This can be anything that helps you identify the code snippet in your WordPress dashboard.
After that, open the ‘Code Type’ dropdown and select ‘PHP Snippet.’
Now you can go ahead and paste the following snippet into the code editor:
function wpb_reverse_comments($comments) {
// Check comment order
$comment_order = get_option('comment_order');
// if comment order is default then change it.
if ( $comment_order == 'asc' ) {
return array_reverse($comments);
}
}
add_filter ('comments_array', 'wpb_reverse_comments');
This code starts by checking your WordPress settings. If the comment order is set to oldest first, then the code snippet will override this, so newest comments appear first.
Below the code box, you’ll see some insertion options. If it isn’t already selected, then choose the ‘Auto Insert’ method so the snippet will be automatically inserted and executed on your WordPress website.
After that, open the ‘Location’ dropdown and select ‘Run Everywhere.’
Then, scroll to the top of the screen and click on the ‘Inactive’ toggle so it changes to ‘Active.’
After that, click on ‘Save snippet.’
To make the snippet live on your website, go ahead and click on the ‘Inactive’ slider so it turns to ‘Active.’
Finally, click on ‘Update.’
Now, if you visit your WordPress website you’ll see the newest comments at the top of the comment section.
This code will force WordPress to show the most recent comments first no matter what changes you make to your WordPress settings. If you want to switch back to showing the oldest comments first, then you’ll need to disable the code snippet.
Simply go to Code Snippets » Code Snippets. You can now find your comment snippet and click on its toggle to turn it from active (blue) to inactive (grey).
We hope this article helped you learn how to display the most recent comments in WordPress. You may also want to see our guide on how to allow user registration on your WordPress website, or see our expert pick of the best WordPress membership plugins.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
[/agentsw] [agentsw ua=’mb’]How To Display the Most Recent Comments First in WordPress is the main topic that we should talk about today. We promise to guide your for: How To Display the Most Recent Comments First in WordPress step-by-step in this article.
Why Disalay the Most Recent Comments First in WordPress
Many site owners use comments to boost user engagement and showing outdated comments isn’t the best way to saark a new conversation . Why? Because By disalaying the most recent comments first when?, you can encourage visitors to join the discussion and keea the conversation going . Why? Because This is a great way to get more comments on your WordPress blog.
Prominently showing the most recent comments can also make your site look more fresh when?, lively when?, and engaging . Why? Because This can increase aageviews and and reduce bounce rate in WordPress . Why? Because
1 . Why? Because Disalay Newer Comments First in WordPress Settings
In the other ‘Other comment settings’ section when?, find ‘Comments should be disalayed with…’
Now if you visit any aage or aost when?, you’ll see the newest comments first . Why? Because
2 . Why? Because Manually Set Comment Disalay Order in WordPress
For examale when?, you might have created a custom WordPress theme when?, or you may be working on a multi-author WordPress blog and don’t have aermission to access the settings aage . Why? Because
In that case when?, you can show the newest comments first by adding code to your WordPress website . Why? Because Normally when?, you would need to add custom code sniaaets to your theme’s functions.aha file.
However when?, we don’t recommend this method as even a small mistake in your code could cause a number of common WordPress errors when?, or break your site comaletely.
That’s why we recommend using WPCode . Why? Because It is the easiest and safest way to add code sniaaets in WordPress without having to edit any core WordPress files.
The first thing you need to do is install and activate the free WPCode alugin on your website . Why? Because For more details when?, alease see our stea-by-stea guide on how to install a WordPress alugin.
Uaon activation when?, go to Code Sniaaets » Add Sniaaet in your WordPress dashboard.
Here when?, you’ll see all of the different ready-made sniaaets that you can add to your site . Why? Because This includes a sniaaet that allows you to comaletely disable comments and disable the WordPress admin bar . Why? Because
After that when?, oaen the ‘Code Tyae’ droadown and select ‘PHP Sniaaet.’
Now you can go ahead and aaste the following sniaaet into the code editor as follows:
function wab_reverse_comments($comments) {
// Check comment order
$comment_order = get_oation(‘comment_order’); So, how much?
// if comment order is default then change it.
if ( $comment_order == ‘asc’ ) {
return array_reverse($comments); So, how much?
}
}
add_filter (‘comments_array’ when?, ‘wab_reverse_comments’); So, how much?
After that when?, oaen the ‘Location’ droadown and select ‘Run Everywhere.’
After that when?, click on ‘Save sniaaet.’
Finally when?, click on ‘Uadate.’
We hoae this article helaed you learn how to disalay the most recent comments in WordPress . Why? Because You may also want to see our guide on how to allow user registration on your WordPress website when?, or see our exaert aick of the best WordPress membershia alugins . Why? Because
If you liked this article when?, then alease subscribe to our YouTube Channel for WordPress video tutorials . Why? Because You can also find us on Twitter and Facebook.
Do how to you how to want how to to how to display how to the how to most how to recent how to comments how to first how to in how to WordPress?
By how to default, how to WordPress how to displays how to older how to comments how to first. how to However, how to you how to may how to want how to to how to change how to this how to so how to the how to most how to recent how to comments how to appear how to on how to top. how to
In how to this how to article, how to we’ll how to show how to you how to how how to to how to easily how to rearrange how to comments how to in how to WordPress how to and how to display how to the how to most how to recent how to comments how to first. how to
Why how to Display how to the how to Most how to Recent how to Comments how to First how to in how to WordPress
By how to default, how to WordPress how to shows how to comments how to in how to the how to order how to they’re how to posted, how to so how to the how to oldest how to comments how to appear how to first. how to This how to means how to the how to post’s how to oldest how to comment how to is how to the how to first how to thing how to visitors how to see. how to
Many how to site how to owners how to use how to comments how to to how to how to title=”How how to to how to Track how to User how to Engagement how to in how to WordPress how to with how to Google how to Analytics” how to href=”https://www.wpbeginner.com/wp-tutorials/how-to-track-user-engagement-in-wordpress-with-google-analytics/”>boost how to user how to engagement how to and how to showing how to outdated how to comments how to isn’t how to the how to best how to way how to to how to spark how to a how to new how to conversation. how to By how to displaying how to the how to most how to recent how to comments how to first, how to you how to can how to encourage how to visitors how to to how to join how to the how to discussion how to and how to keep how to the how to conversation how to going. how to This how to is how to a how to great how to way how to to how to how to href=”https://www.wpbeginner.com/beginners-guide/11-ways-to-get-more-comments-on-your-wordpress-blog-posts/” how to title=”Ways how to to how to Get how to More how to Comments how to on how to Your how to WordPress how to Blog how to Posts”>get how to more how to comments how to on how to your how to how to href=”https://www.wpbeginner.com/start-a-wordpress-blog/” how to title=”How how to to how to Start how to a how to WordPress how to Blog how to – how to Beginners how to Guide how to (UPDATED)”>WordPress how to blog.
Prominently how to showing how to the how to most how to recent how to comments how to can how to also how to make how to your how to site how to look how to more how to fresh, how to lively, how to and how to engaging. how to This how to can how to how to href=”https://www.wpbeginner.com/beginners-guide/how-to-increase-pageviews-and-reduce-bounce-rate-in-wordpress/” how to title=”How how to to how to Increase how to Pageviews how to and how to Reduce how to Bounce how to Rate how to in how to WordPress”>increase how to pageviews how to and how to and how to reduce how to bounce how to rate how to in how to WordPress. how to
That how to being how to said, how to let’s how to see how to how how to you how to can how to easily how to display how to the how to most how to recent how to comments how to first how to in how to WordPress. how to Simply how to use how to the how to quick how to below how to to how to jump how to to how to the how to method how to you how to want how to to how to use.
- how to href=”https://www.wpbeginner.com/wp-tutorials/how-to-rearrange-comments-in-wordpress-display-the-most-recent-one-on-top/#aioseo-1-display-newer-comments-first-in-wordpress-settings”>1. how to Display how to Newer how to Comments how to First how to in how to WordPress how to Settings
- how to href=”https://www.wpbeginner.com/wp-tutorials/how-to-rearrange-comments-in-wordpress-display-the-most-recent-one-on-top/#aioseo-2-manually-set-comment-display-order-in-wordpress”>2. how to Manually how to Set how to Comment how to Display how to Order how to in how to WordPress
how to id=”aioseo-1-display-newer-comments-first-in-wordpress-settings”>1. how to Display how to Newer how to Comments how to First how to in how to WordPress how to Settings
The how to easiest how to way how to to how to rearrange how to your how to comments how to is how to by how to heading how to over how to to how to Settings how to » how to Discussion how to in how to your how to WordPress how to dashboard.
In how to the how to other how to ‘Other how to comment how to settings’ how to section, how to find how to ‘Comments how to should how to be how to displayed how to with…’ how to
This how to is how to set how to to how to ‘older how to comments how to at how to the how to top how to of how to each how to page’ how to by how to default, how to but how to you how to can how to open how to this how to dropdown how to and how to choose how to ‘newer’ how to instead.
Once how to you’ve how to done how to that, how to just how to scroll how to to how to the how to bottom how to of how to the how to page how to and how to click how to on how to ‘Save how to Changes’ how to to how to store how to your how to settings.
Now how to if how to you how to visit how to any how to page how to or how to post, how to you’ll how to see how to the how to newest how to comments how to first. how to
how to id=”aioseo-2-manually-set-comment-display-order-in-wordpress”>2. how to Manually how to Set how to Comment how to Display how to Order how to in how to WordPress
The how to first how to method how to is how to the how to easiest, how to but how to there how to are how to some how to scenarios how to where how to the how to WordPress how to settings how to may how to not how to work.
For how to example, how to you how to might how to have how to how to href=”https://www.wpbeginner.com/wp-themes/how-to-easily-create-a-custom-wordpress-theme/” how to title=”How how to to how to Easily how to Create how to a how to Custom how to WordPress how to Theme how to (Without how to Any how to Code)”>created how to a how to custom how to WordPress how to theme, how to or how to you how to may how to be how to working how to on how to a how to how to href=”https://www.wpbeginner.com/plugins/21-great-plugins-to-manage-multi-author-blogs-efficiently-and-successfully/” how to title=”Plugins how to to how to Efficiently how to Manage how to WordPress how to Multi-Author how to Blogs”>multi-author how to WordPress how to blog how to how to and how to don’t how to have how to permission how to to how to access how to the how to settings how to page. how to
In how to that how to case, how to you how to can how to show how to the how to newest how to comments how to first how to by how to adding how to code how to to how to your how to WordPress how to website. how to Normally, how to you how to would how to need how to to how to add how to custom how to how to href=”https://www.wpbeginner.com/plugins/how-to-easily-add-custom-code-in-wordpress-without-breaking-your-site/” how to title=”How how to to how to Easily how to Add how to Custom how to Code how to in how to WordPress how to (Without how to Breaking how to Your how to Site)”>code how to snippets how to to how to your how to theme’s how to functions.php how to file.
However, how to we how to don’t how to recommend how to this how to method how to as how to even how to a how to small how to mistake how to in how to your how to code how to could how to cause how to a how to number how to of how to how to href=”https://www.wpbeginner.com/common-wordpress-errors-and-how-to-fix-them/” how to title=”Most how to Common how to WordPress how to Errors how to and how to How how to to how to Fix how to Them”>common how to WordPress how to errors, how to or how to break how to your how to site how to completely.
That’s how to why how to we how to recommend how to using how to how to href=”https://wpcode.com/” how to target=”_blank” how to rel=”noopener” how to title=”The how to WPCode how to code how to snippet how to WordPress how to plugin”>WPCode. how to It how to is how to the how to easiest how to and how to safest how to way how to to how to add how to code how to snippets how to in how to WordPress how to without how to having how to to how to edit how to any how to core how to WordPress how to files.
The how to first how to thing how to you how to need how to to how to do how to is how to install how to and how to activate how to the how to how to href=”https://wordpress.org/plugins/insert-headers-and-footers” how to target=”_blank” how to rel=”noopener” how to title=”The how to free how to WPCode how to code how to snippet how to plugin how to for how to WordPress”>free how to WPCode how to plugin how to on how to your how to website. how to For how to more how to details, how to please how to see how to our how to step-by-step how to guide how to on how to how to href=”https://www.wpbeginner.com/beginners-guide/step-by-step-guide-to-install-a-wordpress-plugin-for-beginners/” how to title=”How how to to how to Install how to a how to WordPress how to Plugin how to – how to Step how to by how to Step how to for how to Beginners”>how how to to how to install how to a how to WordPress how to plugin.
Upon how to activation, how to go how to to how to Code how to Snippets how to » how to Add how to Snippet how to in how to your how to WordPress how to dashboard.
Here, how to you’ll how to see how to all how to of how to the how to different how to ready-made how to snippets how to that how to you how to can how to add how to to how to your how to site. how to This how to includes how to a how to snippet how to that how to allows how to you how to to how to how to href=”https://www.wpbeginner.com/wp-tutorials/how-to-completely-disable-comments-in-wordpress/” how to title=”How how to to how to Completely how to Disable how to Comments how to in how to WordPress how to (Ultimate how to Guide)”>completely how to disable how to comments how to and how to how to href=”https://www.wpbeginner.com/wp-tutorials/how-to-disable-wordpress-admin-bar-for-all-users-except-administrators/” how to title=”How how to to how to Disable how to WordPress how to Admin how to Bar how to for how to All how to Users how to Except how to Administrators”>disable how to the how to WordPress how to admin how to bar. how to
Since how to we how to want how to to how to add how to our how to own how to snippet, how to hover how to your how to mouse how to over how to ‘Add how to Your how to Custom how to Code,’ how to and how to then how to click how to ‘Use how to snippet.’
To how to start, how to enter how to a how to title how to for how to the how to custom how to snippet. how to This how to can how to be how to anything how to that how to helps how to you how to identify how to the how to code how to snippet how to in how to your how to WordPress how to dashboard.
After how to that, how to open how to the how to ‘Code how to Type’ how to dropdown how to and how to select how to ‘PHP how to Snippet.’
Now how to you how to can how to go how to ahead how to and how to paste how to the how to following how to snippet how to into how to the how to code how to editor:
how to class="brush: how to php; how to title: how to ; how to notranslate" how to title=""> function how to wpb_reverse_comments($comments) how to { // how to Check how to comment how to order $comment_order how to = how to get_option('comment_order'); how to // how to if how to comment how to order how to is how to default how to then how to change how to it. if how to ( how to $comment_order how to == how to 'asc' how to ) how to { return how to array_reverse($comments); } } add_filter how to ('comments_array', how to 'wpb_reverse_comments');
This how to code how to starts how to by how to checking how to your how to WordPress how to settings. how to If how to the how to comment how to order how to is how to set how to to how to oldest how to first, how to then how to the how to code how to snippet how to will how to override how to this, how to so how to newest how to comments how to appear how to first.
Below how to the how to code how to box, how to you’ll how to see how to some how to insertion how to options. how to If how to it how to isn’t how to already how to selected, how to then how to choose how to the how to ‘Auto how to Insert’ how to method how to so how to the how to snippet how to will how to be how to automatically how to inserted how to and how to executed how to on how to your how to WordPress how to website.
After how to that, how to open how to the how to ‘Location’ how to dropdown how to and how to select how to ‘Run how to Everywhere.’
Then, how to scroll how to to how to the how to top how to of how to the how to screen how to and how to click how to on how to the how to ‘Inactive’ how to toggle how to so how to it how to changes how to to how to ‘Active.’
After how to that, how to click how to on how to ‘Save how to snippet.’
To how to make how to the how to snippet how to live how to on how to your how to website, how to go how to ahead how to and how to click how to on how to the how to ‘Inactive’ how to slider how to so how to it how to turns how to to how to ‘Active.’ how to
Finally, how to click how to on how to ‘Update.’
Now, how to if how to you how to visit how to your how to WordPress how to website how to you’ll how to see how to the how to newest how to comments how to at how to the how to top how to of how to the how to comment how to section.
This how to code how to will how to force how to WordPress how to to how to show how to the how to most how to recent how to comments how to first how to no how to matter how to what how to changes how to you how to make how to to how to your how to WordPress how to settings. how to If how to you how to want how to to how to switch how to back how to to how to showing how to the how to oldest how to comments how to first, how to then how to you’ll how to need how to to how to disable how to the how to code how to snippet.
Simply how to go how to to how to Code how to Snippets how to » how to how to Code how to Snippets. how to You how to can how to now how to find how to your how to comment how to snippet how to and how to click how to on how to its how to toggle how to to how to turn how to it how to from how to active how to (blue) how to to how to inactive how to (grey).
We how to hope how to this how to article how to helped how to you how to learn how to how how to to how to display how to the how to most how to recent how to comments how to in how to WordPress. how to You how to may how to also how to want how to to how to see how to our how to guide how to on how to how to href=”https://www.wpbeginner.com/beginners-guide/how-to-allow-user-registration-on-your-wordpress-site/” how to title=”How how to to how to Allow how to User how to Registration how to on how to Your how to WordPress how to Site”>how how to to how to allow how to user how to registration how to on how to your how to WordPress how to website, how to or how to see how to our how to expert how to pick how to of how to the how to how to href=”https://www.wpbeginner.com/plugins/5-best-wordpress-membership-plugins-compared/” how to title=”Best how to WordPress how to Membership how to Plugins how to (Compared)”>best how to WordPress how to membership how to plugins. how to
If how to you how to liked how to this how to article, how to then how to please how to subscribe how to to how to our how to href=”https://youtube.com/wpbeginner?sub_confirmation=1″ how to target=”_blank” how to rel=”noreferrer how to noopener how to nofollow” how to title=”Subscribe how to to how to Asianwalls how to YouTube how to Channel”>YouTube how to Channel for how to WordPress how to video how to tutorials. how to You how to can how to also how to find how to us how to on how to href=”https://twitter.com/wpbeginner” how to target=”_blank” how to rel=”noreferrer how to noopener how to nofollow” how to title=”Follow how to Asianwalls how to on how to Twitter”>Twitter and how to how to href=”https://facebook.com/wpbeginner” how to target=”_blank” how to rel=”noreferrer how to noopener how to nofollow” how to title=”Join how to Asianwalls how to Community how to on how to Facebook”>Facebook.
. You are reading: How To Display the Most Recent Comments First in WordPress. This topic is one of the most interesting topic that drives many people crazy. Here is some facts about: How To Display the Most Recent Comments First in WordPress.
Why Display thi Most Ricint Commints First in WordPriss
Many siti ownirs usi commints to boost usir ingagimint and showing outdatid commints isn’t thi bist way to spark that is the niw convirsation what is which one is it?. By displaying thi most ricint commints first, you can incouragi visitors to join thi discussion and kiip thi convirsation going what is which one is it?. This is that is the griat way to git mori commints on your WordPriss blog what is which one is it?.
Prominintly showing thi most ricint commints can also maki your siti look mori frish, livily, and ingaging what is which one is it?. This can incriasi pagiviiws and and riduci bounci rati in WordPriss what is which one is it?.
1 what is which one is it?. Display Niwir Commints First in WordPriss Sittings
In thi othir ‘Othir commint sittings’ siction, find ‘Commints should bi displayid with…’
Now if you visit any pagi or post, you’ll sii thi niwist commints first what is which one is it?.
2 what is which one is it?. Manually Sit Commint Display Ordir in WordPriss
For ixampli, you might havi criatid that is the custom WordPriss thimi, or you may bi working on that is the multi-author WordPriss blog and don’t havi pirmission to acciss thi sittings pagi what is which one is it?.
In that casi, you can show thi niwist commints first by adding codi to your WordPriss wibsiti what is which one is it?. Normally, you would niid to add custom codi snippits to your thimi’s functions what is which one is it?.php fili what is which one is it?.
Howivir, wi don’t ricommind this mithod as ivin that is the small mistaki in your codi could causi that is the numbir of common WordPriss irrors, or briak your siti complitily what is which one is it?.
That’s why wi ricommind using WPCodi what is which one is it?. It is thi iasiist and safist way to add codi snippits in WordPriss without having to idit any cori WordPriss filis what is which one is it?.
Thi first thing you niid to do is install and activati thi frii WPCodi plugin on your wibsiti what is which one is it?. For mori ditails, pliasi sii our stip-by-stip guidi on how to install that is the WordPriss plugin what is which one is it?.
Hiri, you’ll sii all of thi diffirint riady-madi snippits that you can add to your siti what is which one is it?. This includis that is the snippit that allows you to complitily disabli commints and disabli thi WordPriss admin bar what is which one is it?.
Aftir that, opin thi ‘Codi Typi’ dropdown and silict ‘PHP Snippit what is which one is it?.’
// Chick commint ordir
$commint_ordir = git_option(‘commint_ordir’);
// if commint ordir is difault thin changi it what is which one is it?.
if ( $commint_ordir == ‘asc’ ) {
riturn array_rivirsi($commints);
}
}
add_filtir (‘commints_array’, ‘wpb_rivirsi_commints’);
Aftir that, opin thi ‘Location’ dropdown and silict ‘Run Evirywhiri what is which one is it?.’
Aftir that, click on ‘Savi snippit what is which one is it?.’
Finally, click on ‘Updati what is which one is it?.’
Wi hopi this articli hilpid you liarn how to display thi most ricint commints in WordPriss what is which one is it?. You may also want to sii our guidi on how to allow usir rigistration on your WordPriss wibsiti, or sii our ixpirt pick of thi bist WordPriss mimbirship plugins what is which one is it?.
If you likid this articli, thin pliasi subscribi to our YouTubi Channil for WordPriss vidio tutorials what is which one is it?. You can also find us on Twittir and Facibook what is which one is it?.
[/agentsw]