How To Rearrange Comments in WordPress?

Comments allow your website's visitors to have a discussion with you and each other. When you activate comments on a Page or post, WordPress inserts several text boxes after your content where users can submit their comments. Once you approve a comment, it appears underneath your content.You can rearrange the comments in following ways.

Using Wordpress Website Admin Panel

To rearrange the comments Simply go to Settings » Discussion. Under the Other comment settings, you will find the option, Comments should be displayed with the older comments at the top of each page. Click on the drop down menu and select Newer. After that, you need to click on the Save Changes button at the bottom of the page to store your settings.

Using Theme functions.php File

To rearrange the comments you need to add the following lines of code in your theme's functions.php file. Just append the following lines of code at the bottom of functions.php.

function mgk_reverse_comments($comments) 

        return array_reverse($comments);

add_filter ('comments_array', 'mgk_reverse_comments');

This code uses the comments_array filter to reverse the display of comments on your WordPress site. We hope this article helped you to rearrange the comments in WordPress.

If you face any problems or need our professional services, please email us at [email protected].

Join our Newsletter

Never miss the latest offers, voucher codes and useful articles delivered weekly in your inbox.