How to Show the Most Recent Comments in WordPress

Do you want to display the most recent comment in your comments section? If you do not change the order your comments are displayed, your newest comments will be out of sight at the bottom of the page. This can make it very difficult for visitors to communicate with each other in the comments section.

This is a serious problem since the comments section is a place designed for visitors to communicate with each other and leave valuable feedback on your content. Thankfully, WordPress is fully customizable, so it’s quite easy to change this. Today, I will demonstrate how to show the most recent comments at the top in WordPress using three methods.

Why Show the Most Recent Comments

If you have a very active comments section, newer comments can easily get buried at the bottom. This is not good for the community because only the first couple of comments will get seen. This may discourage some visitors from bothering to leave comments.

Think about the last time you decided to scroll to the bottom of a comments section. It’s probably hard to remember that since it is not a common thing to do.

Thus, moving the most recent comments to the top so they can be seen is a simple and logical choice. Not only will it help visitors communicate with each other, but it will make the comments section seem more lively.

This is because the comments at the top will be changing frequently instead of being the exact same every time. This is especially helpful if some of your first comments say «First!», which still happens a lot.

Show the Most Recent Comments in WordPress

Today, I will demonstrate how to show the most recent comments at the top in WordPress with three methods. The first method involves using the built-in comments section settings. There is a setting that allows you to rearrange comments from newest to oldest.

If for some reason, you do not want to use the first method, you can accomplish this by adding a few lines of code to your theme’s functions.php file. In either case, you will be able to display the most recent comments at the top.

Finally, I will show you the plugin to use that will accomplish this for you as well.

Method 1: Discussion Settings

The discussion settings allow you to tweak the various settings of your comments section. They also allow you to assign Gravatars and Author profile images.

Step 1: Go to the Discussion Page

On the left-hand admin panel, click on Settings and select the Discussion option.

Click on Settings and select the Discussion option.

Step 2: Change «Older» to «Newer» in Dropdown Menu

Locate the Other comment settings section. The last setting in this section will decide the display order for your comments. By default, it should display Older. Change it from Older to Newer.

Change it from Older to Newer.

Step 3: Save Changes

Scroll down to the bottom of the page and click on the «Save Changes» button.

Click on the "Save Changes" button.

Congratulations, you have successfully rearranged your WordPress comments to display the most recent comments at the top.

You can change this back at any time by repeating the steps and changing it from newer to older.

Method 2: Code Approach

If you do not want to use the first method, don’t worry, another alternative is to do a bit of coding. It is very simple and will only require you to copy and paste a few lines of code.

Since you will be editing files on the backend of your website, it is a good idea to create a backup of your website. This will ensure that if a mistake is made, you can revert your website to before the mistake was made.

Step 1: Log Into cPanel and Click on File Manager

Let’s start by logging into the cPanel and clicking on the File Manager option. The File Manager will allow you to access all of the files related to your website.

Click on the File Manager option.

Step 2: Locate the functions.php Folder

You need to locate your theme’s functions.php file. Click on the public_html directory, then click on the wp-content folder. Inside of this folder, you will find all of the content related to your website.

Click on the themes folder and enter the folder of the theme you are currently using. Finally, right-click on the functions.php file and select the Edit option.

Select the "Edit" option.

Step 3: Edit the Popup Window

A pop-up window will show up. This box will warn you to create a backup of your files before editing anything. This will ensure that you can revert your website back to when it was working if something goes wrong.

Click on the «Edit» button. A new tab will open containing all of the code from the file.

Click on the "Edit" button.

Step 4: Copy and Paste Relevant Code

Copy and paste the following lines of code into your theme’s functions.php file:[ht_message mstyle=»info» title=»» show_icon=»» id=»» class=»» style=»» ]function swap_comment_order($comments) {
return array_reverse($comments);
}
add_filter (‘comments_array’, ‘swap_comment_order’);[/ht_message]

Once you have inserted the code into the functions.php file, click on the «Save Changes» button to finish.

Click on the "Save Changes" button.

This will have the same effect as the last method and display the newest comments at the top of the page.

Method 3: Using a Plugin

The last method you can use to show recent comments on your blog is by using a plugin. Basically, you want to find a plugin that is easy to use and allows you to accomplish this without a lot of stress.

Luckily, I found just the plugin for this. Let’s take a quick look at it.

Better Recent Comments

Better Recent Comments plugin

Better Recent Comments improves on the built-in WordPress recent comment functionality by providing a more flexible widget and shortcode with options to show the user’s actual comment. You also have the option to show avatars and the ability to show or hide the comment date.

The plugin is clean, smooth, and very easy to use. There are actually quite a few options built into the plugin. Some of the main ones include:

  • Comment Formatting
  • Display Number of Comments
  • Choose Comment Dates
  • Avatar Size
  • Post Status
  • Post Type
  • Excerpts

The plugin gives you a very easy way to display the most recent comment and also add details to those comments.

All you have to do is install and activate the plugin. Once the plugin is up and running, you really have 2 main options.

  1. You can go to the widgets section of your site, and then use the built-in widget to display recent comments using the settings.
  2. Use the available shortcode [better_recent_comments] and its configurations to display the most recent comments on any post or page.

Interact With Your Visitors

The comments section allows visitors to communicate with each other, but it also allows you to interact with visitors. This is very important because regularly interacting with your visitors will help build a strong relationship.

Keep in mind there are many ways to interact with your visitors. This may be through an email subscription or more commonly on social media platforms.

Social media platforms are the best way to interact with your visitors. There are multiple platforms and they generate billions of views every month.

This is not just a good choice for interactions, but marketing on these platforms is essential in today’s world. Almost every single major business corporation has a significant social media presence, so don’t be afraid to join them.

Do you think showing the newest comments should be the default option? Which method have you used?

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

Este sitio usa Akismet para reducir el spam. Aprende cómo se procesan los datos de tus comentarios.

Copy link