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

540 Comments

  1. Posted 19 December 2008 at 9:32 am | Permalink

    I was correct in my previous comment and have now found the solution to this problem.

    For those of you wanting to get this plugin to work correctly in WordPress 2.7, check this out [ http://www.blaenkdenum.com/get-paged-comments-plugin-to-work-in-wordpress-27/ ].

    Thanks again Keyvan for this plugin!

  2. Posted 19 December 2008 at 12:44 pm | Permalink

    Blaenk: Thanks a lot for that! I’m glad you’ve found a workaround. To be honest, I haven’t even looked at WP 2.7 yet, so I have no idea what conflicts. Seeing as there is still interest though, I’m going to release another version for 2.7. I’d also like to allow users to keep the existing permalinks (without having to rename the path segment to something else), but I won’t know if that’s possible until I’ve had a chance to look at the code.

    I’ll post again about this in the next few days. Thanks again.

  3. Posted 20 December 2008 at 12:20 am | Permalink

    Keyvan: The only way I see that being possible without also modifying the WordPress core is by adding a much higher priority level to paged_comments_fancy_url, maybe something like -10 haha but even then I wouldn’t be sure. I’ll try it out right now. Nope it didn’t seem to work. Is the init hook the most earliest hook when loading a page?

    It seems to me like modifying the core is the only other way to go. The comment-page redirection/matching occurs in the following core files of a vanilla 2.7 install:

    wp-includes\canonical.php [Lines: 136, 140, 167]
    wp-includes\comment-template.php [Lines: 475]
    wp-includes\link-template.php [Lines: 1226, 1232, 1340]
    wp-includes\rewrite.php [Lines: 1262, 1343, 1368, 1415, 1425]

    So I guess modifying the permalink in the plugin is the most convenient way to go. Either way for me it’s not that big of a deal modifying the permalink so I’m fine with it. Thanks again for the plugin! :)

  4. Posted 20 December 2008 at 6:03 pm | Permalink

    Hey Keyvan.

    Following Blaenk idea, I found a solution without modifying the url structure. Just changing in 4 files: canonical.php, comment-template.php, link-template.php y rewrite.php (located in wp-includes) the following: comment-page by something similar (eg. commentS-page).

    It works great now.

    You can see it here: http://www.mazcue.com.ar/plugin-paged-comments-wordpress-27-fix/

    Regards!

  5. gt
    Posted 21 December 2008 at 6:13 pm | Permalink

    why some of you prefer to edit the wordpress core files?

    Is that a big problem change the url structure of paged comments plugin?

  6. Posted 22 December 2008 at 3:38 am | Permalink

    WP 2.7 update
    Thanks for the help guys. I’ve just tried it myself and I think the fix for WP 2.7 is simply to remove the 2 calls to url_to_postid() in function paged_comments_fancy_url. This call was there to prevent false positives, but now that WP itself uses the same path segment I’d used in the plugin, the call does actually return the valid post ID where it previously returned false (0).

    You can see a visual diff of the changed file. I’ll try and put out a release soon – I’m hoping to use the WP settings available in 2.7 to allow users to override the ones specified in the plugin’s config file.

    gt: The URL structure might not be a big deal for new users of the plugin, or even for some existing users, but if your URLs have been indexed/linked to/bookmarked, then changing the URL structure can be a big problem. In fact, it’s probably no accident that the WP developers chose the same comment page identifier I’d used in the plugin – it allows users of the plugin to switch to WP’s comment paging without having to worry about broken URLs.

  7. Posted 22 December 2008 at 3:47 pm | Permalink

    hey,
    I tried the fix, but even with the new version, I think there is still a problem with wordpress post pagination.

    I am using permalink structure
    http://www.domain.com/%postname%

    so my pages have the following link
    http://www.domain.com/article-A/1 -> page 1
    http://www.domain.com/article-A/2 -> page 2
    http://www.domain.com/article-A/3 -> page 3

    When this plugin is active, the other pages links don`t seem to work, every link shows me only the first page of article A

    What could be the reason ?

    Regards

  8. gt
    Posted 22 December 2008 at 4:35 pm | Permalink

    please note that wp’s automatic update will delete the configuration file (at least for me)!

  9. Jim
    Posted 23 December 2008 at 6:55 am | Permalink

    I got the plugin working for my site. The issue is that some of my other plugins don’t work, plugins like Wp-Grins and Ajax Edit Comments. I read through the intro, so am I supposed to copy the things from the comments-paged php file to my comments file of my theme to insure compatibility? Not sure how to get it all compatible with this plugin.

  10. Posted 23 December 2008 at 2:32 pm | Permalink

    I got another problem:
    When i get a “new comment” mail / information and i klick on the link in the mail…i see always the first comment on the page.

    ===>> i already set “last” in den config, but it stills jumps to the first comment :(

  11. Posted 23 December 2008 at 3:04 pm | Permalink

    Michael: I tested WP 2.7 using a multi-page post with the same permalink structure and had no problems. Are you using WP 2.7? And which version of the plugin are you using?

    gt: You’re right, I tested the automatic update and it deleted the config file. I don’t think there’s anything I can do about that other than move the config file out of that folder.

    Jim: I haven’t use those plugins. There’s a good chance the plugins are simply not compatible. You might get them all working by tweaking files, but I can’t really help with that.

    Heiko: Which version of WordPress are you using?

  12. gt
    Posted 24 December 2008 at 4:00 pm | Permalink

    @ keyvan

    that is a common issue of WP’s automatic update.

    If you have time for a more complex solution, you can provide a simple administrative configuration panel which stores settings in the wordpress db, so we will be able even to localize it!

  13. Jim
    Posted 24 December 2008 at 8:17 pm | Permalink

    Cr*p, I was afraid of that. I will try taking a look around the files, weird that they wouldnt be compatible since they’re both popular, but this is the one I need more. Thanks for the feedback.

  14. Jim
    Posted 24 December 2008 at 10:10 pm | Permalink

    @HEIKO – I noticed your site uses the ajax edit comments and the paged comments plugin without problems. Can you tell me how you got these two plugins working together? It would save me alot of trouble. Thank you in advance.

  15. Jim
    Posted 24 December 2008 at 11:52 pm | Permalink

    @Keyvan

    One more question popped to mind, I saw that you use search comment plugin, but when I tried using google to find it, it did not come up with anything. Can you give the link to it, or where you can get it?

  16. Jim
    Posted 29 December 2008 at 3:04 am | Permalink

    Still having trouble resizing the comment bar…. looked but I dont see height or width adjustment in the plugin settings. Sorry for all the questions, as I am sort of new to all this. Thank you

  17. Eddie
    Posted 29 December 2008 at 11:14 am | Permalink

    I have a problem with this plugin, maybe somebody could assist me (I really searched a lot for a solution):

    Every comment on my blog has a permalink like “blog.com/#comment-(commentnumber)”.

    When I install the plugin all the comments have a structure like “blog.com/page(number)/#comment-(commentnumber)”.

    The problem now is that all previous links to comments do not work anymore.

    Is there a solution to make the links work?

    Thaks a lot.

    Eddie

  18. Pero
    Posted 3 January 2009 at 7:08 pm | Permalink

    Is it possible to rename “Show all”?

  19. Posted 8 January 2009 at 8:43 pm | Permalink

    Is it right, that the possibility to reply to a comment for every user is disabled by the paged-comments plugin?

    I am using wp2.7 and the latest paged-comments plugin (2.9.1) and the only place where I am able to reply to a comment is on my dashboard or administration for comments… then listed as normal comment and NOT as reply…

    So the native threaded comments from wordpress are disabled… are you gonna fix this? :)

  20. Posted 10 January 2009 at 12:04 am | Permalink

    Well – is there allready a fix for the cookie-problem?
    I’m using the latest version of paged comments on WP 2.7 and the auto-filling of the comment-form doesn’t seem to work.

  21. Posted 22 January 2009 at 2:33 am | Permalink

    Hi, the plugin works fine in my blog.
    Do you know how I can add the page number of the comments in the title tag?

    Thanks

  22. Posted 27 January 2009 at 7:11 pm | Permalink

    Hi Keyvan,

    Just a quick note from a long-time user of your plugin (now drawn away to the dark side of WP’s built-in paging, though…)…

    In case it might be of any use in terms of building up handling for threading and the funky case of numbering when threading is enabled, I’ve just today released a plugin that provides numbering for WP’s built-in threading, and a trac submission to fix a page counting bug in the WordPress core (report number 8973). Here’s the counting plugin:

    Greg’s Threaded Comment Numbering

    All the best,
    Greg

  23. Eric
    Posted 27 January 2009 at 10:31 pm | Permalink

    Just like Chris, I’m using the latest version of paged comments on WP 2.7 and the auto-filling of the comment-form doesn’t work. Version 2.6.4 works fine…

  24. Posted 30 January 2009 at 7:13 pm | Permalink

    hi, i would like to suggest to include an option in the admin panel if you would like to add a nofollow and noindex attribute to the pagination links, to avoid duplicate contents for SEO purposes :D

    just a suggestion. :D More power to this plugin keyvan! :)

  25. Posted 24 February 2009 at 6:10 am | Permalink

    I’m using 2.71 with pixeled 1.9 themes, i got this error when i try to use this plugin. Can u help me?thx in advanced.

    Fatal error: Call to a member function num_pages() on a non-object in /***/wp-content/themes/pixeled-1.9/comments.php on line 232

  26. Posted 13 May 2009 at 2:07 pm | Permalink

    Hi keyvan
    you plugin is awesome , but make a problem with wordpress 2.7 , when enable the plugin , the reply to comment function of wordpress 2.7 can’t work . i mean no link or reply button can see on any comment :/ also showing threaded comments for replies breaks after enabling the plugin , could you fix that on next version? ;) thanks

  27. seachen
    Posted 19 May 2009 at 10:24 pm | Permalink

    May i know what is this error?
    Fatal error: Cannot redeclare class Pager in /home/mykenjiwu/domains/mykenjiwu.com/public_html/wp-content/plugins/paged-comments/paged-comments.php on line 518

  28. Posted 16 June 2009 at 1:34 pm | Permalink

    Hello,

    Your plugin is very useful. Thanks a lot for coding it.

    I had a few questions. I am using a blog in Arabic, hence, the info of each comment (date, “Says”, etc.) is translated to Arabic in my themes. However, when I installed the plugin, it overwrote my comments’ page code and displayed another with different formatting and language.

    I did try to edit the main plugin page and translate things like “Show all”, but I couldn’t find a place to have my original comments’ theme to be used. I would be grateful if you let me know how to do that.

    Thanks a lot.
    wa7di

  29. Posted 17 June 2009 at 7:22 pm | Permalink

    Hello keyvan,
    your plug-in looks awesome , but does it work with wordpress 2.8? I use the Black Canvas theme from studiopress.
    thanks for you time.

  30. Posted 18 June 2009 at 12:45 am | Permalink

    Do you plan to update this plugin for version 2.8 of wordpress :D ?

  31. Danish Muzaffar
    Posted 2 July 2009 at 11:36 pm | Permalink

    I did try to edit the main plugin page and translate things like “Show all”, but I couldn’t find a place to have my original comments’ theme to be used. I would be grateful if you let me know how to do that.

    Thanks a lot.

  32. Posted 10 July 2009 at 10:46 pm | Permalink

    ¿Can you update your plugin for WordPress 2.8?, thank you very much.

  33. Posted 14 July 2009 at 2:36 am | Permalink

    Hi keyvan, I discovered a incompatibility from “Paged Comments” (Vers. 2.9.1) to the WP Theme Atahualpa 3.4.x (but it worked with Atahualpa 3.3.3).
    The whole Sub-Content (posts & pages) didn’t appear, though the Startpage (Home) seemed to be OK.
    The Theme is at http://wordpress.bytesforall.com/
    My Blog runs with WP 2.7.1.
    Thanks for Your work

  34. Gavin
    Posted 27 July 2009 at 4:23 pm | Permalink

    Can I second Eddie’s question? (here).

    All of our older links to comments no longer work once we turned on paged comments.

  35. Posted 27 July 2009 at 7:39 pm | Permalink

    Thanks for the comments, everyone. Please see the note at the top of this page — I have decided not to continue development of the plugin as WordPress now offers comment paging in the core. The URL structure is almost identical (if you used the plugin with fancy_url enabled) so it should be fairly straightforward to switch to standard WP comment paging.

  36. Posted 7 August 2009 at 10:38 pm | Permalink

    Regarding “what’s missing from WordPress’ standard comment paging”: In addition to “page number” (and “next page” and “previous page”) buttons, provide visitor with the “Show All” (comments in one page) button — see: http://bit.ly/RQJEz .

  37. Anna
    Posted 4 September 2009 at 4:16 am | Permalink

    I’m trying to enable the “fill_last_page”-function for one individual page. In the config.php I’ve chosen fill_last_page = false but I would like it to be “true” for this one individual page. I tried to add a custom field called fill_last_page but it didn’t help anything. Any tips what to try next?

  38. Posted 27 October 2009 at 11:57 am | Permalink

    ¿Can you update your plugin for WordPress 2.8?, thank you very much.

  39. aviationMY
    Posted 4 January 2010 at 7:13 pm | Permalink

    hi, im using WordPress 2.9

    my problem is:

    1. when i activate the plugin via my plugin page in admin, nothing happened

    2. i search for the configuration in settings but i dont see your plugin there..

    3. i disable my Wp page comments it didt work too.

    4. i then re-enable, same problem occasion occur,

    5. i set your ” paged-comments-config.php” from 10 to 5 comments per page even i have 200 comments…nothing shows up!

    *****conclusion..when i activate yours, nothing happened,

    im using Thesis theme, but i dont think this is my problem,

    please help me out!

    regards,
    MALAYSIA

  40. Posted 6 January 2010 at 2:15 am | Permalink

    aviationMY: The plugin is no longer supported as comment paging is now a core feature. Please read the notice at the top of this page.

281 Trackbacks