We create beautiful & user-friendly websites and provide quality web development services worldwide.
Contact us to get started on your project.


How to Add WordPress Paged Comments without a Plugin (plus CSS Styling)

Published by Veron Ang | 28

How to Add WordPress Paged Comments Without a Plugin

Did you know that there is a nifty WordPress function that allows comment pagination? Since version 2.7, WordPress has made available the paginate_comments_links function in the core (thus obsoleting the paged comments plugin). Instead of having your visitors click on Previous or Next Comments links, you can display a more elegant numbered list of comment pages. This is very useful for popular blog posts that have received many comments.

After adding the function, by default your comment pagination would look something like this:

1 2 3 … 10 Next »

With nice styling, we can achieve this:

Add and Style WordPress Paged Comments

  1. Enable paged comments within WordPress by going to SETTINGS > DISCUSSION, and checking the box “Break comments into pages”. You can enter any number for the “top level comments per page”.
  2. Open your comments.php template file and add the following line where you want the comment pagination to appear.

    Note: If you are currently using the previous_comments_link and next_comments_link functions, you may want to replace them with the pagination.

    <div class="pagination">
    	<?php paginate_comments_links(); ?>

    Optional: You can also modify the text displayed for the Previous and Next links. By default they show up as « Previous and Next » with the double arrow heads. In this example we will use single arrow heads. After adding the arguments, our function becomes:

    <?php paginate_comments_links(
    array('prev_text' => '&lsaquo; Previous', 'next_text' => 'Next &rsaquo;')
    ); ?>
  3. To style it, add the following to your stylesheet (typically style.css).

    Note: If you have followed our WordPress pagination tutorial, you can skip this step. The CSS classes and styling are kept exactly the same to maintain a consistent look and feel throughout your website.

    .pagination {
    padding:20px 0;
    .pagination span, .pagination a {
    margin: 2px 2px 2px 0;
    padding:6px 9px 5px 9px;
    background: #555;
    .pagination a:hover{
    background: #3279BB;
    .pagination .current{
    padding:6px 9px 5px 9px;
    background: #3279BB;

That’s it! Let me know if you find it useful!

About the Author

Veron Ang is a , developer and WordPress expert at Sparklette Studio. She has been building websites for as long as she can remember, and graduated with a bachelor's degree in computer science from the National University of Singapore.


  • Hi,

    I am using your code to break comments into pages…

    I am Using Theme Simplicity Bright: http://koch-werkstatt.de/2007/03/24/wordpress-theme-simplicity/

    But Comments not not breaking into pages but only button appears….

    How to enable that???

    • Have you enabled comments paging in your WordPress admin? Please see Step 1.

      • Hi Veron, Yes I have activated in WordPress Admin Panel but it seems my theme doesn’t support that but how to enable theme pagination support in theme itself…???

        • Use wp_list_comments()

  • thanks, it work.

    • tks,i’ll testit

  • Thank you. This works like a dream!

  • You wouldn’t happen to know how to add a “show all” button that allows readers to view all comments (i.e. do away with the paging)?

    Thanks in advance for any suggestions!

  • is there a way to replace the first and last page numbers with “first” and “last”?

    So i’d be something like <>

  • nice turtorial, but how, to implement it using ajax, without a plugin, so that unnecessary movement of pages, only the movement of the div that displays the list of comments.
    Can you give turtorialnya, which can be applied directly on the theme wordpress.
    thank you.

    im waitting aswer (im notif u post)

  • Many thanx for sharing this pagination trick!

    I have one question; I would like to use it on my static homepage where I have 1 post with comments. Is there a way to make the pagination work there as well?

    My code I use to display the post and it’s comments;

    Thanx in advance!

  • This worked for my website but there’s a problem. on the right sidebar of my website down. how to solve it?

  • […] by adding new functions to your theme:How to Add WordPress Pagination without a Plugin [Enhanced]How to Add WordPress Paged Comments without a Plugin (plus CSS Styling)How to Display Most Commented Posts in WordPress without a PluginHow to Display Every User’s […]

  • Very useful, thanks a lot!

  • thank you. simple tutorial. I not use your css but i only use the wordpress function and use my css pagination. thanks.

  • Hi, im using your method. I prefer it because seems much more clean than a plugin.
    But I need change how it shows results, I need remove dots from large links list, only show numbers.
    I tried modify function “paginate_comments_links” without any result. Can you help me??

  • Hello,

    How to add Twitter ID for WordPress blog?
    Please help me, if you want to me reply my mail.

    Best regards..

  • Thanks. It was so helpful

  • Hello, I have a problem

    “Open your comments.php template file and add the following line where you want the comment pagination to appear.
    Note: If you are currently using the previous_comments_link and next_comments_link functions, you may want to replace them with the pagination.”

    Where is previous_comments_link and next_comments_link functions that I have to replace for the above code?

    My website is:


  • I´ve installed the plugin succesfully, the code i have to remplace was this:

    1 && get_option( 'page_comments' ) ){ // Are there comments to navigate through?

    previous_comments_link( '← '. esc_html__( 'Older Comments', 'Raindrops' ) );

    next_comments_link( esc_html__( 'Newer Comments ', 'Raindrops' ). '→' );

  • But the pagination comments only see it at the bottom of the page, in the top i show you a screenshot of my web, where only see Newer post and older post:


    At the bottom works perfectly:


  • Now I have a problem with pagination comments because I`ve paginated the comments of my posts, so I can´t order the comments by numbers.

    In each page start counting again.


    Page of the comments number 1:

    Comment 1
    comment 2
    comment 3

    Page of the comments number 2:

    Comment 1
    comment 2
    comment 3

    I´d like in the page comments number two, the count were 4,5,6

    What kind of CSS have I to add?

  • Hi Veron,

    Thanks for the above comment pagination code.

    I am curious to know what plugin is being used to display “You Might Also Like” for the popup appearing along with the Facebook like at the footer.


  • Nice tutorial Veron, I like your tutorial and I also used your codehttp://sgwordpress.com/teaches/how-to-add-wordpress-pagination-without-a-plugin/ for my wordpress theme.. Thanks so much..

  • thank u

  • Hello
    This is best but how can i convert it to Ajax?Please help me

  • Hello your image in header is awosome !may help me to download it.Thanks very much . .

  • good pagination

Leave a comment