WordPress Paged Comments Plugin

This plugin is no longer being developed. WordPress has had paged comments support in the core since version 2.7. The comment paging you see here is using WordPress’s built-in code and not my plugin.

Paged Comments is a plugin for WordPress to allow comment paging. Useful for those popular blog entries receiving many comments, or a simple guestbook page within WordPress.

Features

  • Comment ordering: show latest comments first, or last
  • Specify number of comments to display per page
  • Enable paging for all posts and pages, or on a per-post basis
  • Give users the choice to view all comments on one page with a ‘show all’ link
  • Specify the first or last page of comments to load by default
  • See paged-comments-config-sample.php for more

Download — Latest Version

Installation (for WordPress 2.3 up to 2.7)

If you’re upgrading from a previous version, skip these installation steps and read the upgrade steps. Note: WordPress’ automatic upgrade feature will erase the plugin’s config file. If you’re going to use it, make sure you backup your paged-comments-config.php file first.

  1. Download and extract plugin files to a folder locally.
  2. Read through and edit paged-comments-config-sample.php to configure, then save the file as paged-comments-config.php.
  3. Upload the whole paged-comments directory to /wp-content/plugins/. The plugin files should now be in /wp-content/plugins/paged-comments/.
  4. Enable the plugin through the WordPress admin interface. That’s it!

Optional Steps

  • WP 2.7 users: If use_wp_config is set to true (default), you can make changes to the plugin config using the WP admin interface. Go to Settings > Discussion and look under ‘Other comment settings’.
  • To customise the template to work better with your theme: Open the plugin’s themes folder and find the subfolder corresponding to the WordPress theme you’d like paged comments enabled on (or if your theme isn’t listed, choose the ‘default’ folder). Upload comments-paged.php to the appropriate WordPress theme folder (found in [wordpress]/wp-content/themes/).

    For example, if you’re using the default WordPress theme, copy [paged-comments-plugin]/themes/default/comments-paged.php to [wordpress]/wp-content/themes/default/. (The plugin always tries to load comments-paged.php from your active theme folder first.)

    Make any modifications to comments-paged.php. The file is based on the comments.php file, so if your theme is very different it might be easier to copy in the necessary elements from paged-comments.php. View the diff report to see what you need to change.

Examples of Use

The comments on this page are handled by the plugin, but it’s also used by the following sites:

Questions?

Paid Support

If you run a commercial site and you’re having difficulty setting up paged comments, I offer paid support. Feel free to get in touch: keyvan (at) k1m.com

43 Comments

  1. CJ2600 says:

    Hi Keyvan,
    Thank you very much for your plugin. I think this plugin is a must for blogs with many comments. Honestly, I would suggest to WordPress to distribute the blog code with your plugin already imbedded, very useful.
    Some of my posts get over 130 comments and the page size becomes huge, over 130KB. With your pluging it’s only 23KB and I’m getting 13 pages of content instead just 1.:)
    Here are my problems:
    1. For some reason when I enable the plugin the comment form gets screwed up. The fields are not aligned and the name of the field is displayed under it. Tested in IE, Firefox, Opera, the same problem. When I disable the plugin everything is fine. I’m not sure is it the theme problem or not. Can you help? You can see the form on the bottom of the page.
    2. My second question might be a little bit dummy. I tried to read through all comments on your site, but didn’t find the answer. Sorry if I overlooked it. When I browse through the paged comments I notice that the URL of the page is not browser friendly and looks like: http://www.laptoprepairguy.com/?p=14&cp=12#comments
    How can I make it more browser friendly, so the URL reflects the original name, something like: http://www.laptoprepairguy.com/laptop/2006/01/04/toshiba-laptop-overheating/comments/12/ Etc.

    Thank you in advance.
    CJ2600
    Sorry for broken English.

  2. cj2600 says:

    Hi Keyvan,
    I set fancy URL to true, but still getting ?= at the end.
    Am I missing something? How can I set the plugin so it has a custom name it the URL?
    Plz
    Thank you.

  3. cj2600 says:

    Hey Keyvan,
    Please disregard my last comment.
    Sorry for being so stupid.
    I’m trying to set this option to true in paged-comments.php
    through the WordPress plugin edit interface. “$paged_comments->fancy_url = true”
    But actually I have to set it in paged-comments-config.php
    2 different files!!! 🙂
    Thanks a lot. Feel bad for bothering you.

    But my comment form is still broken, not alligned properly.

  4. Keyvan says:

    Hi CJ, Sorry for the late reply (I’ve been away). I had a look at the page you linked to and the comment form appears okay for me (both in Firefox and IE). Have you fixed the problem? If not please send me a screenshot so I can see what the problem is and I’ll try and fix it. Thanks for the nice comments – I’m glad you find the plugin useful.

  5. CJ2600 says:

    Keyvan,
    The problem is fixed. I’m not sure exactly what was wrong with the form, but after I put in the table everything is fine.
    The problem with a fancy URL is fixed too. Sorry, it was my mistake. I tried to configure paged-comments.php instead paged-comments-config.php. Thank you to Steve (http://www.automatorworld.com/). He is using your plugin too. I connected him and he was very kind to help me.
    I love this plugin! I do not have to worry that it takes a long time to load my page.

    One more question about SEO. Is this pluging Google friendly? For example, I have over 150 comments and I set plugin to display 10 comments per page. Will Google see and index 15 different pages? Can my website get penalized by Google because all 15 pages share the same content?

    Thank you.

  6. Keyvan says:

    CJ, I’m glad you managed to fix the other problems.

    Regarding SEO, I’m not much of an expert in the area so I can’t say if Google or any other search engine will penalise – very unlikely I would think. However, if it does bother you (or you’d simply prefer not to have the content loaded again and again while you’re navigating through comment pages) you can make minor changes to your template file to prevent the content from being displayed when a comment page has been requested. See the FAQ entry if you’d like to implement this.

    Hope that helps.

  7. Phillip says:

    Hi,

    Great plugin, thank you.

    I have the same problem as Dayna who posted in #83. I read each subsequent post carefully and you seem to have solved her problem. However, I don’t understand exactly what you/she did. Sorry.

    I have a modified (cut and paste!) comments-paged file that can be viewed here:
    http://www.planetphillip.com/comments-paged.phps

    If you have some time I would be most grateful if you could have a quick look. I fully understand if you can’t. I don’t expect personal support.

    A good example of the problem can be seen here:
    http://www.planetphillip.com/posts/wivenhoe-the-fall-of-ravenholm-single-player-half-life-2-mod/

    TIA
    Phillip

  8. Keyvan says:

    Thanks Phillip. If you’re using the latest version of the plugin, you’ll find two options in the config file: all_posts and all_pages. Try setting all_posts to false and all_pages to true. That should be it. If it’s still not working after this change, please post again. (By default all_posts and all_pages are both enabled.)

  9. zhouqb says:

    good plugin, thanks

  10. Phillip says:

    Keyvan,

    Unfortunately your suggestion hasn’t worked. I’ve tried all combinations of true and false for those two options.

    TIA
    Phillip

  11. […] This plugin is a combination of Brian’s Threaded Comments and Keyvan’s WordPress Paged Comments Plugin. Trustin Lee has written an plugin Threaded and Paged Comments Plugin for WordPress 1.5, but the structure is complicated. I borrowed the SQL statements and functions of it, and made the two plugins work together. Now the structure is tidier, since the plugin files are put into one directory, except the comments-paged.php file. […]

  12. Keyvan says:

    Phillip, I’ll have to test those two options again. The other solution was: “If your theme has a separate template file for pages (the default theme has single.php and page.php) you can edit single.php and remove the call to paged_comments_template() (to return it to the state it was in prior to step 5). This will remove paging from all posts and will bypass the Paged Comments plugin completely.”

    Some themes provide separate template files for pages and posts. If yours does you can prevent comment paging on posts by editing the appropriate template (usually single.php) and removing the call to paged_comments_template() – it should only contain a call to comments_template().

    Of course I’ll have a look to see why the options aren’t working. Will post back when I’ve had a chance to test.

  13. […] Gail: For my own use (personal or business), I really like Keyvan Minoukadeh’s Paged Comments plugin and Ryan Duff’s Contact Form plugin. The Paged Comments plugin makes pages with a lot of comments look organized. I frankly don’t like skimming through pages that are too long (That’s one of the main reasons why I put The_Excerpt tag on my themes’ home page loop instead of The_Content). The Contact Form… I can’t say that I CAN’T live without it, but it’s mighty useful when I’m feeling lazy and don’t want to make my own contact form for a site I’m doing that’s running on WordPress. […]

  14. Shawna says:

    Hola 🙂

    I have a ?

    How to I edit this so that the comments start showing from the first page rather than the last page?

    Thank you 🙂

  15. Keyvan says:

    Shawna, you can edit the config file (paged-comments-config.php) and either set ordering to ascending (‘ASC’) or keep it as descending but change default_page to ‘first’. Hope that helps. Please post back if you have no luck.

  16. Shawna says:

    Greetings Keyva, thank you for answering my question so quickly 🙂

    On line 92 I changed DESC to ASC and on line 102 I changed auto to first, but with no luck.It still shows the last posts first.

    🙂

  17. Shawna says:

    Sorry Keyvan, I actually had my file named incorrectly and that is why the changes were not taking place.Your instructions below worked perfectly and I thank you 😀

  18. Keyvan says:

    Thanks for reporting back Shawna. 🙂 I was actually just about to post asking if you’d renamed the file (I think this step is very easy to overlook). Glad it’s finally working for you. Let me know if you come across any other problems.

  19. Shawna says:

    Silly me, I had .php at the end of the file twice *embarassed*

  20. Frank says:

    Hallo Keyvan,
    i have write a guestbook plugin for wordpress. Many people search for a function for paged comment in this guestbook. I have use your plugin and write a new guestbook with your nice plugin.
    I hope you enjoy this and thank you very much for you open code.
    WP-Guestbook
    With best regards Frank.

  21. […] ????????????????????????????????????????????????????????????????????comment_reply_ID?0??????????? Brian’s Threaded Comments?Keyvan’s Paged Comments Plugin???????????? […]

  22. Nathan Olsen says:

    Hi Keyvan —

    I’d like to use your plugin on my site but I’m finding that it conflicts with Permalink Redirect. I looked through the comments for your plugin and was surprised that no one else had encountered this. Any suggestions?

  23. Keyvan says:

    Hi Nathan, I’ve just downloaded the plugin (v0.5.2) and enabled it on my WP2 testbed (using the current paged comments release – 2006-04-07) and it appears to work okay. What problems are you having running the two together?

  24. valerie says:

    Hey there – great plugin. I just installed it after upgrading to 2.0.3, I get this error on comments:

    Fatal error: Call to a member function on a non-object

    That’s on the lines that read:

    <?php if ($paged_comments->pager->num_pages() > 1): ?>

    …for displaying the pages I believe…

    The comments still go through, however. My commenting uses Ajax so it just shows the error right there where the comment should go, but refreshing the page shows the comment instead.

    I appreciate anything you can tell me to point me in the right direction. Thanks so much! 🙂

  25. Laslo says:

    hi, I’m using your plugin in my blog. It’s been working great in posts, but now I tried to applied it to a Page http://www.cinencuentro.com/soundtrack/
    but it seems like nothing happens. I added paged_comments = on
    and then comments_per_page = 15
    but still no change in the comments.
    any ideas what might be happening?

  26. Keyvan says:

    Valerie: Let me know which Ajax plugin you’re using and I’ll try it and see if there’s a conflict. Thanks.

    Laslo: I take it you’re using custom fields to enable paging for this particular page. That shouldn’t be a problem, but can you try setting all_pages to true and also check to see if your theme has a separate template file for pages. Some themes have single.php and page.php, it could be that you haven’t applied step 5 to the page template so it’s still using the default (non-paged) comments template.

  27. Laslo says:

    thanks Keyvan.
    I forgot to add the step 5 to my page.php =P

  28. valerie says:

    Hi – I really have no idea about the Ajax other than it’s what comes standard with the theme: K2 – http://getk2.com
    And, I dunno why I didn’t think of this before, but disabling the Ajax commenting (in the K2 control panel) does not give the error on commenting…
    Thanks!!

  29. Nathan Olsen says:

    Keyvan —

    I also have Permalink Redirect 0.5.2 installed. The problem occurs when I try to click on a comment page other than the one displayed by default. That is, let’s say that the default comment page is 18 as it is on your paged-comments post. If I were to click on page 17 (or any other page), the permalink would briefly change to end in /comment-page-17/#comments and then get redirected back to the default page. I’m guessing the change I need to make is more on the Permalink Redirect plugin end by writing up a regular expression to skip redirecting those sub-pages. But I haven’t gotten that to work yet.

  30. Sonali says:

    I’m having wordpress mingus version. This plugin isn’t working with it. Pls help and tell me what should I do.

    No good to realize that wordpress isn’t backward compatible… You people always change the very architecture of the package making the latest plugins unusable on previous versions…

  31. Xnxx says:

    Are you still working on this plugin?
    I get this error when I activate it 🙁
    I am running WordPress 1.5.1.2
    What am I doing wrong?
    Help me please!

  32. Keyvan says:

    Laslo: No problem, glad it’s working.

    Valerie: The plugin package contains a template for K2 users, but I doubt it’s any use now – and if I remember correctly it didn’t provide ajax comment posting at the time. Glad it works without ajax, but I’ll take a closer look and try and get it to work with the ajax commenting enabled. Hopefully for the next version.

    Nathan: I’ll take a closer look. If you’re interested, here’s my WP2 testbed using both the paged comments plugin and the permalink redirect plugin. It’s not running on the latest WP2 version, so I’ll try and upgrade and check it again.

    Sonali: This plugin is for WordPress versions 1.5 and 2 (clearly stated at the top of this page). Mingus (version 1.2) is now fairly old and I don’t really have the time to add support for it. The very first version I built was running on 1.2 though, I’m not sure if I released that version or not, but if you’ve got time you could try downloading the version with the earliest date from redalt.com and give it a try.

    Xnxx: I am still working on this plugin. Please let me know what error message you get when you activate it and I’ll see if I can help.

  33. […] Keyvan Word Press Comment Page Plug-in… If you use WP and get a lot of comments, this plug-in is just what you may need. […]

  34. Hi

    Thanks for a great plugin. i have one problem and one additional question
    -My permalink structure is http://www.connectedinternet.co.uk/2005/10/18/570. i’ve changed the fancy_url key to true but when I click on any comment pages it displays the correct url e.g. http://www.connectedinternet.co.uk/2005/10/18/570/comment-page-2/#comments but it jumps back up to the top of the post rather than showing the start of the 2nd page of comments. How do i fix?

    thanks for any help.

    Everton

  35. The problem I’m experiencing is the same as Nathan in 179 – I’ve tried turning Permalink Redirect both on and off but no joy.

  36. Keyvan says:

    Everton: I’m still not sure you’re experiencing the same problem as Nathan – conflict with my plugin and the Permalink Redirect plugin. I think the problem you’re having is not that the requested comments are not loading, but that rather than the browser jumping straight to the comments it’s displaying the page from the top. To fix that you’ll need to edit your template and change <h3 class=”reply”> to include an id attribute with the value “comments”: <h3 class=”reply” id=”comments”> – if you look at the source of this page you’ll see what I mean.

    Nathan: I’ve upgraded my version of WP to 2.0.3 and I’m still not experiencing a conflict. In fact, looking at it closer I think it’s because Paged Comments strips the URL segment identifying the comment page from $_SERVER[‘REQUEST_URI’] before the redirect plugin looks at it. Also, if a comment page is requested, your page slug will always end in a slash anyway, to separate it from the comment page segment (e.g. /2006/page-slug/comment-page-10) so, again, I can’t quite see why there should be a conflict between these two. Please give me any more information and I’ll be happy to look into it further. You can see both plugins working by trying these links: /2006/01/test <– no trailing slash so the redirect plugin kicks in.
    /2006/01/test/comment-page-5/#comments <– comment page 5 requested and correctly loads.

    If anyone else is experiencing a conflict, please post and I’ll investigate further. Also, if for some reason the redirect plugin is seeing the request URI before paged comments plugin has acted to remove the comment segment, you can try adding this skip pattern to the redirect plugin’s skip rules: ^(.+/)comment-page-([0-9]+)/?$

  37. Thanks – sorted! Thanks for looking into this.

    EB

  38. Eddie says:

    Great plugin!

    Is there a “comments-paged.php” for theme Blix?

  39. Keyvan says:

    Eddie, there isn’t, but you should find the template for the default theme works okay for most themes. Don’t be put off if you can’t see your theme listed. I’m usually happy to create a paged comments template for a theme if the theme’s comments template deviates from the WP default. I don’t have much time right now, but you can attempt it yourself if you like – it’s not very difficult to do.

  40. Mark Fleming says:

    I’m wondering if anyone here can help me out with a problem Im having getting Paged Comments to show up on a page made static as the Front page with Static Front Page Plugin. You can see the discussion at WP in the tail end of this topic:

    http://wordpress.org/support/topic/33005/page/2?replies=54#post-404194

  41. […] To use Paged Comments plugin in your WordPress blog, you need to download the plugin from the author’s site. Installation is pretty straight forward as detailed on the site, but you will need to upload the comments-paged.php in the plugin’s themes folder to your theme template folder, where it will be used to process and list the comments instead of the default comments.php. As the comments template contains unique design and format for each WordPress theme, so the comments-paged.php for Paged Comments plugin must match the original theme’s comments template in order not to deviates too much from the theme’s design. […]

  42. […] Paged CommentsZuviele ausgehende Links bei den Kommentaren kann der 666seo hiermit in den Griff bekommen. Es teilt die Kommentare in einzelne Seiten. […]

  43. Thilak says:

    Worked like a charm !! Thanks

  44. _ck_ says:

    Trying it on a fairly fresh WP 2.0.3 install though i do have a bunch of plugins. No ajax or anything fancy. But no luck in getting it to work.

    I only get

    “Fatal error: Call to a member function on a non-object”

    How and where would I start diagnosing this?

    many thanks!

  45. Jimy says:

    The necessary plugin (:
    It is established easily and perfectly works.
    Thank u so much!

  46. Nathan Olsen says:

    Keyvan —

    I just took another look at the conflict I was having with your plugin and Permalink Redirect and I solved the issue. My permalink structure was set-up so that articles should NOT have a trailing slash, which works fine if I’m only using Permalink Redirect OR Paged Comments, but which fails miserably if I try to use both. I personally prefer not having trailing slashes on articles — only directories — but that’s not possible if I want to use both of these plugins right now. Is this an issue on your end or with Permalink Redirect?

  47. […] Javi Moya, que no es raro encontrar en su blog artículos con más de 500 comentarios, me ha chivado que existe un pluggin para paginar comentarios en wordpress. […]

  48. _ck_ says:

    I got it working, it was my fault as to try to not use a seperate comments-paged.php template and to try to integrate it into the regular template.

    Any suggestions from anyone on how I can hack wp-comments-post.php to make it return the the last page on the newest comment so they can see their post? Does comments-post support redirect_to by any chance?

    I don’t want to do newest comments on top – it’s confusing for some newbies.

  49. _ck_ says:

    Any ideas as to why it breaks any added queries on my WP 2.0 setup when they work fine on yours?

    ie.
    http://keyvan.net/code/paged-comments/comment-page-20/?testflag=true

    will load the page properly on your setup but if I try to do that on mine I get a 404 ?
    If you are running WP 2.x do you have a special rewrite rule setup?

7 Trackbacks

  1. By ???? / Paged Threaded Comments plugin on 23 May 2006 at 5:39 am

    […] This plugin is a combination of Brian’s Threaded Comments and Keyvan’s WordPress Paged Comments Plugin. Trustin Lee has written an plugin Threaded and Paged Comments Plugin for WordPress 1.5, but the structure is complicated. I borrowed the SQL statements and functions of it, and made the two plugins work together. Now the structure is tidier, since the plugin files are put into one directory, except the comments-paged.php file. […]

  2. […] Gail: For my own use (personal or business), I really like Keyvan Minoukadeh’s Paged Comments plugin and Ryan Duff’s Contact Form plugin. The Paged Comments plugin makes pages with a lot of comments look organized. I frankly don’t like skimming through pages that are too long (That’s one of the main reasons why I put The_Excerpt tag on my themes’ home page loop instead of The_Content). The Contact Form… I can’t say that I CAN’T live without it, but it’s mighty useful when I’m feeling lazy and don’t want to make my own contact form for a site I’m doing that’s running on WordPress. […]

  3. By ???? / Paged Threaded Comments plugin update on 3 June 2006 at 3:44 am

    […] ????????????????????????????????????????????????????????????????????comment_reply_ID?0??????????? Brian’s Threaded Comments?Keyvan’s Paged Comments Plugin???????????? […]

  4. […] Keyvan Word Press Comment Page Plug-in… If you use WP and get a lot of comments, this plug-in is just what you may need. […]

  5. […] To use Paged Comments plugin in your WordPress blog, you need to download the plugin from the author’s site. Installation is pretty straight forward as detailed on the site, but you will need to upload the comments-paged.php in the plugin’s themes folder to your theme template folder, where it will be used to process and list the comments instead of the default comments.php. As the comments template contains unique design and format for each WordPress theme, so the comments-paged.php for Paged Comments plugin must match the original theme’s comments template in order not to deviates too much from the theme’s design. […]

  6. By WordPress Theme 666seo on 9 July 2006 at 7:23 pm

    […] Paged CommentsZuviele ausgehende Links bei den Kommentaren kann der 666seo hiermit in den Griff bekommen. Es teilt die Kommentare in einzelne Seiten. […]

  7. By Com » Ferran » Paginar comentarios de Wordpress on 6 August 2006 at 12:44 am

    […] Javi Moya, que no es raro encontrar en su blog artículos con más de 500 comentarios, me ha chivado que existe un pluggin para paginar comentarios en wordpress. […]