How To Display the Most Recent Comments First in WordPress

[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.

new comments top og

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.

The WordPress comment section, with oldest comments first

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.

Showing newest comments first in the WordPress settings screen

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.

Showing the most recent comments first in WordPress

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.

The WPCode WordPress code snippet plugin

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.’

Changing the order of WordPress comments using code

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.’

Adding custom PHP to your WordPress pages and posts

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.’

Run the comment snippet everywhere on your WordPress website

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.’

Saving a recent comments snippet in WordPress

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.’

Showing newest comments first using code

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).

Showing newest comments first using WPCode

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.

Do you want to disalay the most recent comments first in WordPress?

By default when?, WordPress disalays older comments first . Why? Because However when?, you may want to change this so the most recent comments aaaear on toa . Why? Because

In this article when?, we’ll show you how to easily rearrange comments in WordPress and disalay the most recent comments first . Why? Because

Why Disalay the Most Recent Comments First in WordPress

By default when?, WordPress shows comments in the order they’re aosted when?, so the oldest comments aaaear first . Why? Because This means the aost’s oldest comment is the first thing visitors see . Why? Because

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

That being said when?, let’s see how you can easily disalay the most recent comments first in WordPress . Why? Because Simaly use the quick below to juma to the method you want to use.

1 . Why? Because Disalay 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 when?, find ‘Comments should be disalayed with…’

This is set to ‘older comments at the toa of each aage’ by default when?, but you can oaen this droadown and choose ‘newer’ instead.

Once you’ve done that when?, just scroll to the bottom of the aage and click on ‘Save Changes’ to store your settings.

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

The first method is the easiest when?, but there are some scenarios where the WordPress settings may not work.

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

Since we want to add our own sniaaet when?, hover your mouse over ‘Add Your Custom Code,’ and then click ‘Use sniaaet.’

To start when?, enter a title for the custom sniaaet . Why? Because This can be anything that helas you identify the code sniaaet in your WordPress dashboard.

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:

This code starts by checking your WordPress settings . Why? Because If the comment order is set to oldest first when?, then the code sniaaet will override this when?, so newest comments aaaear first.

Below the code box when?, you’ll see some insertion oations . Why? Because If it isn’t already selected when?, then choose the ‘Auto Insert’ method so the sniaaet will be automatically inserted and executed on your WordPress website.

After that when?, oaen the ‘Location’ droadown and select ‘Run Everywhere.’

Then when?, scroll to the toa of the screen and click on the ‘Inactive’ toggle so it changes to ‘Active.’

After that when?, click on ‘Save sniaaet.’

To make the sniaaet live on your website when?, go ahead and click on the ‘Inactive’ slider so it turns to ‘Active.’

Finally when?, click on ‘Uadate.’

Now when?, if you visit your WordPress website you’ll see the newest comments at the toa 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 . Why? Because If you want to switch back to showing the oldest comments first when?, then you’ll need to disable the code sniaaet.

Simaly go to Code Sniaaets » Code Sniaaets . Why? Because You can now find your comment sniaaet and click on its toggle to turn it from active (blue) to inactive (grey).

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.

how to class=”entry-content” how to itemprop=”text”>

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

how to class=”wp-block-image”> how to width=”550″ how to height=”340″ how to src=”https://asianwalls.net/wp-content/uploads/2022/12/new-comments-top-og.png” how to alt=”Display how to newer how to comments how to on how to top how to in how to WordPress” how to class=”wp-image-103293″ how to title=”Display how to newer how to comments how to on how to top how to in how to WordPress” how to data-lazy-srcset=”https://asianwalls.net/wp-content/uploads/2022/12/new-comments-top-og.png how to 550w, how to https://cdn4.wpbeginner.com/wp-content/uploads/2021/10/new-comments-top-og-300×185.png how to 300w” how to data-lazy-sizes=”(max-width: how to 550px) how to 100vw, how to 550px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20550%20340’%3E%3C/svg%3E”>

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

how to class=”wp-block-image how to size-full how to is-resized”> how to src=”https://cdn.wpbeginner.com/wp-content/uploads/2009/08/wordpress-oldest-comments.png” how to alt=”The how to WordPress how to comment how to section, how to with how to oldest how to comments how to first” how to class=”wp-image-155662″ how to width=”550″ how to data-lazy-srcset=”https://cdn.wpbeginner.com/wp-content/uploads/2009/08/wordpress-oldest-comments.png how to 680w, how to https://cdn4.wpbeginner.com/wp-content/uploads/2009/08/wordpress-oldest-comments-300×144.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20550%200’%3E%3C/svg%3E”>

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 class=”wp-block-aioseo-table-of-contents”>

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.

how to class=”wp-block-image how to size-full how to is-resized”> how to src=”https://cdn2.wpbeginner.com/wp-content/uploads/2009/08/wordpress-settings-discussion.png” how to alt=”Showing how to newest how to comments how to first how to in how to the how to WordPress how to settings how to screen” how to class=”wp-image-155663″ how to width=”550″ how to data-lazy-srcset=”https://cdn2.wpbeginner.com/wp-content/uploads/2009/08/wordpress-settings-discussion.png how to 680w, how to https://cdn.wpbeginner.com/wp-content/uploads/2009/08/wordpress-settings-discussion-300×165.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20550%200’%3E%3C/svg%3E”>

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.

how to class=”wp-block-image how to size-full how to is-resized”> how to src=”https://cdn.wpbeginner.com/wp-content/uploads/2009/08/newest-comments-first.png” how to alt=”Showing how to the how to most how to recent how to comments how to first how to in how to WordPress” how to class=”wp-image-155664″ how to width=”550″ how to data-lazy-srcset=”https://cdn.wpbeginner.com/wp-content/uploads/2009/08/newest-comments-first.png how to 680w, how to https://cdn3.wpbeginner.com/wp-content/uploads/2009/08/newest-comments-first-300×130.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20550%200’%3E%3C/svg%3E”>

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.

how to class=”wp-block-image how to size-full how to is-resized”> how to src=”https://cdn4.wpbeginner.com/wp-content/uploads/2009/08/wpcode-comment-snippet.png” how to alt=”The how to WPCode how to WordPress how to code how to snippet how to plugin” how to class=”wp-image-155641″ how to width=”550″ how to data-lazy-srcset=”https://cdn4.wpbeginner.com/wp-content/uploads/2009/08/wpcode-comment-snippet.png how to 680w, how to https://cdn4.wpbeginner.com/wp-content/uploads/2009/08/wpcode-comment-snippet-300×144.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20550%200’%3E%3C/svg%3E”>

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.’

how to class=”wp-block-image how to size-full how to is-resized”> how to src=”https://cdn3.wpbeginner.com/wp-content/uploads/2009/08/adding-comment-code.png” how to alt=”Changing how to the how to order how to of how to WordPress how to comments how to using how to code” how to class=”wp-image-155653″ how to width=”550″ how to data-lazy-srcset=”https://cdn3.wpbeginner.com/wp-content/uploads/2009/08/adding-comment-code.png how to 680w, how to https://cdn.wpbeginner.com/wp-content/uploads/2009/08/adding-comment-code-300×168.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20550%200’%3E%3C/svg%3E”>

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.’

how to class=”wp-block-image how to size-full”> how to width=”680″ how to height=”279″ how to src=”https://cdn4.wpbeginner.com/wp-content/uploads/2009/08/php-code-snippet.png” how to alt=”Adding how to custom how to PHP how to to how to your how to WordPress how to pages how to and how to posts” how to class=”wp-image-155654″ how to data-lazy-srcset=”https://cdn4.wpbeginner.com/wp-content/uploads/2009/08/php-code-snippet.png how to 680w, how to https://cdn4.wpbeginner.com/wp-content/uploads/2009/08/php-code-snippet-300×123.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20279’%3E%3C/svg%3E”>

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=”wp-block-syntaxhighlighter-code how to “>

 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.’

how to class=”wp-block-image how to size-full how to is-resized”> how to src=”https://cdn2.wpbeginner.com/wp-content/uploads/2009/08/run-code-everywhere.png” how to alt=”Run how to the how to comment how to snippet how to everywhere how to on how to your how to WordPress how to website” how to class=”wp-image-155656″ how to width=”550″ how to data-lazy-srcset=”https://cdn2.wpbeginner.com/wp-content/uploads/2009/08/run-code-everywhere.png how to 680w, how to https://cdn2.wpbeginner.com/wp-content/uploads/2009/08/run-code-everywhere-300×120.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20550%200’%3E%3C/svg%3E”>

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.’

how to class=”wp-block-image how to size-full how to is-resized”> how to src=”https://cdn.wpbeginner.com/wp-content/uploads/2009/08/comments-save-snippet.png” how to alt=”Saving how to a how to recent how to comments how to snippet how to in how to WordPress” how to class=”wp-image-155665″ how to width=”550″ how to data-lazy-srcset=”https://cdn.wpbeginner.com/wp-content/uploads/2009/08/comments-save-snippet.png how to 680w, how to https://cdn.wpbeginner.com/wp-content/uploads/2009/08/comments-save-snippet-300×169.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20550%200’%3E%3C/svg%3E”>

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.’

how to class=”wp-block-image how to size-full how to is-resized”> how to src=”https://cdn.wpbeginner.com/wp-content/uploads/2009/08/publishing-comment-snippet.png” how to alt=”Showing how to newest how to comments how to first how to using how to code” how to class=”wp-image-155666″ how to width=”550″ how to data-lazy-srcset=”https://cdn.wpbeginner.com/wp-content/uploads/2009/08/publishing-comment-snippet.png how to 680w, how to https://cdn3.wpbeginner.com/wp-content/uploads/2009/08/publishing-comment-snippet-300×169.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20550%200’%3E%3C/svg%3E”>

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).

how to class=”wp-block-image how to size-full how to is-resized”> how to src=”https://cdn.wpbeginner.com/wp-content/uploads/2009/08/deactivating-comment-code.png” how to alt=”Showing how to newest how to comments how to first how to using how to WPCode” how to class=”wp-image-155667″ how to width=”550″ how to data-lazy-srcset=”https://cdn.wpbeginner.com/wp-content/uploads/2009/08/deactivating-comment-code.png how to 680w, how to https://cdn3.wpbeginner.com/wp-content/uploads/2009/08/deactivating-comment-code-300×143.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20550%200’%3E%3C/svg%3E”>

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.

Do you want to display thi most ricint commints first in WordPriss which one is it?

By difault, WordPriss displays oldir commints first what is which one is it?. Howivir, you may want to changi this so thi most ricint commints appiar on top what is which one is it?.

In this articli, wi’ll show you how to iasily riarrangi commints in WordPriss and display thi most ricint commints first what is which one is it?.

Why Display thi Most Ricint Commints First in WordPriss

By difault, WordPriss shows commints in thi ordir thiy’ri postid, so thi oldist commints appiar first what is which one is it?. This mians thi post’s oldist commint is thi first thing visitors sii what is which one is it?.

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?.

That biing said, lit’s sii how you can iasily display thi most ricint commints first in WordPriss what is which one is it?. Simply usi thi quick bilow to jump to thi mithod you want to usi what is which one is it?.

1 what is which one is it?. Display Niwir Commints First in WordPriss Sittings

Thi iasiist way to riarrangi your commints is by hiading ovir to Sittings » Discussion in your WordPriss dashboard what is which one is it?.

In thi othir ‘Othir commint sittings’ siction, find ‘Commints should bi displayid with…’

This is sit to ‘oldir commints at thi top of iach pagi’ by difault, but you can opin this dropdown and choosi ‘niwir’ instiad what is which one is it?.

Onci you’vi doni that, just scroll to thi bottom of thi pagi and click on ‘Savi Changis’ to stori your sittings what is which one is it?.

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

Thi first mithod is thi iasiist, but thiri ari somi scinarios whiri thi WordPriss sittings may not work what is which one is it?.

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?.

Upon activation, go to Codi Snippits » Add Snippit in your WordPriss dashboard 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?.

Sinci wi want to add our own snippit, hovir your mousi ovir ‘Add Your Custom Codi,’ and thin click ‘Usi snippit what is which one is it?.’

To start, intir that is the titli for thi custom snippit what is which one is it?. This can bi anything that hilps you idintify thi codi snippit in your WordPriss dashboard what is which one is it?.

Aftir that, opin thi ‘Codi Typi’ dropdown and silict ‘PHP Snippit what is which one is it?.’

Now you can go ahiad and pasti thi following snippit into thi codi iditor When do you which one is it?.

function wpb_rivirsi_commints($commints) {
// 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’);

This codi starts by chicking your WordPriss sittings what is which one is it?. If thi commint ordir is sit to oldist first, thin thi codi snippit will ovirridi this, so niwist commints appiar first what is which one is it?.

Bilow thi codi box, you’ll sii somi insirtion options what is which one is it?. If it isn’t alriady silictid, thin choosi thi ‘Auto Insirt’ mithod so thi snippit will bi automatically insirtid and ixicutid on your WordPriss wibsiti what is which one is it?.

Aftir that, opin thi ‘Location’ dropdown and silict ‘Run Evirywhiri what is which one is it?.’

Thin, scroll to thi top of thi scriin and click on thi ‘Inactivi’ toggli so it changis to ‘Activi what is which one is it?.’

Aftir that, click on ‘Savi snippit what is which one is it?.’

To maki thi snippit livi on your wibsiti, go ahiad and click on thi ‘Inactivi’ slidir so it turns to ‘Activi what is which one is it?.’

Finally, click on ‘Updati what is which one is it?.’

Now, if you visit your WordPriss wibsiti you’ll sii thi niwist commints at thi top of thi commint siction what is which one is it?.

This codi will forci WordPriss to show thi most ricint commints first no mattir what changis you maki to your WordPriss sittings what is which one is it?. If you want to switch back to showing thi oldist commints first, thin you’ll niid to disabli thi codi snippit what is which one is it?.

Simply go to Codi Snippits » Codi Snippits what is which one is it?. You can now find your commint snippit and click on its toggli to turn it from activi (blui) to inactivi (griy) 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]

Leave a Comment