Rearranging comments to display the latest one on top is becoming a new trend that more and more top bloggers are implementing on their site. If your blog has a lot of user interaction, then this option should be your choice because often the recent comments get buried on the last pages or at the very bottom. In this article we will show you how you can rearrange your comments and display the most recent one on top.
There are multiple ways that have been shared online and some even require you to edit your core files. Editing core files is never a good option because every time you upgrade WordPress, you have to make that change again. We have two ways that you can use to rearrange comments and display them in the descending order showing the most recent comment first that will not require you to change the core files at all.
Method 1
This method requires you to add a simple code to your comments.php. First you need to find the line:
foreach ($comments as $comment) {
Note: These may vary slightly in different themes. Immediately before this line you need to add:
add $comments = array_reverse($comments);
With the reverse function, you can rearrange comments and show them in the descending order.
Source: Demonboy
Method 2
The second method makes the job even easier for those who are not good with codes. It is a plugin called Simple Reverse Comments. With this plugin, you do not have to edit any template files at all. Simply download the plugin and activate it.
Download this Plugin from WordPress Plugin Directory
How To Rearrange Comments in WordPress – Display the Most Recent One on Top
Rearranging comments to display the latest one on top is becoming a new trend that more and more top bloggers are implementing on their site. If your blog has a lot of user interaction, then this option should be your choice because often the recent comments get buried on the last pages or at the very bottom. In this article we will show you how you can rearrange your comments and display the most recent one on top.
There are multiple ways that have been shared online and some even require you to edit your core files. Editing core files is never a good option because every time you upgrade WordPress, you have to make that change again. We have two ways that you can use to rearrange comments and display them in the descending order showing the most recent comment first that will not require you to change the core files at all.
Method 1
This method requires you to add a simple code to your comments.php. First you need to find the line:
foreach ($comments as $comment) {Note: These may vary slightly in different themes. Immediately before this line you need to add:
With the reverse function, you can rearrange comments and show them in the descending order.
Source: Demonboy
Method 2
The second method makes the job even easier for those who are not good with codes. It is a plugin called Simple Reverse Comments. With this plugin, you do not have to edit any template files at all. Simply download the plugin and activate it.
Download this Plugin from WordPress Plugin Directory
About Editorial Staff
Editorial Staff at WPBeginner mainly Syed and David.
What's Next
Get WPBeginner Articles in your Inbox:
Related Posts
I think this is one of the most important info for me. And i'm glad reading your article. But should remark on some general things, The website style is wonderful, the articles is really excellent
- spam
- offensive
- disagree
- off topic
LikeI am typically to running a blog and i really respect your content. The article has actually peaks my interest. I’m going to bookmark your web site and maintain checking for new information.I am typically to running a blog and i really respect your content. The article has actually peaks my interest. I’m going to bookmark your web site and maintain checking for new information.
- spam
- offensive
- disagree
- off topic
LikeI prefer method 2, it is easier than codes. I hate codes coz I am not good at it. Thanks for the plugin.
- spam
- offensive
- disagree
- off topic
Like@Grace T In your Dashboard, drop down the Plugins list and click Add New. In there you will see a link on top to Upload. Click that and then the Browse button to locate the ZIP file you downloaded. Then click Install Now.
You may be prompted for your FTP login details. If you are, enter it and click the Proceed button. The next page will show 2 links: Activate Plugin and Return to Plugins page. Click Activate Plugin to start using it now.
- spam
- offensive
- disagree
- off topic
LikeI downloaded the plugin, but I'm really not great with technology, so how do you activate it? This sounds like a stupid question, but I really need help!
- spam
- offensive
- disagree
- off topic
Like@Jim Hutchinson: That discussion settings stuff doesn't work at all.
@Editorial Staff: It would have been better if you just said replace with .
I had to go to the wordpress forum to find this solution.
- spam
- offensive
- disagree
- off topic
LikeA plugin is not needed for this. Just go into the Discussion Settings and select how you want the comments to show, older or newer.
"Comments should be displayed with the [older][newer] comments at the top of each page"
- spam
- offensive
- disagree
- off topic
LikeOh, I just realised you're right! Thankyou!
- spam
- offensive
- disagree
- off topic
LikeI see that this plugin has not been updated since 2008 so I'm wary about using it.
Also, I do see the setting in Discussion and have set my comments to display Newest at the top, but that doesn't seem to work.
Anyone have any thoughts?
thanks
- spam
- offensive
- disagree
- off topic
LikeUse the default option in the Discussion area.
- spam
- offensive
- disagree
- off topic
LikeWill it work with Disqus?
- spam
- offensive
- disagree
- off topic
LikeI am having a custom WordPress theme developed by someone from elance.com and I would like to know whether or not I'll be able to install plugins such as Simple Reverse Comments because my theme is custom. Can you shed light on this? Maybe I should cut my losses and go with something like the Thesis theme which is more cookie-cutter? Thank you for your blog, it has been very helpful to me.
- spam
- offensive
- disagree
- off topic
LikeYou should be able to install this plugin in your custom theme.
- spam
- offensive
- disagree
- off topic
Like