WordPress Plugin: Comment Connection

Wordpress logoHave you ever had a lot of comments on a blog post and had trouble following the conversation? Now you can have no trouble at all, with my new WordPress Plugin – Comment Connection.

Comment Connection is a simple plugin that detects the @commenter reference in a comment and turns that name into a link to a previous comment. An example can be seen on this post. It works by filtering comments when they are printed, then retrieves the comment ID of the last comment made by the person being referenced. There is no modification necessary to make it work, and it will work with previous comments as well.

It has been tested with the most recent version of WordPress, 2.7. If you have problems with an earlier version, or even if it works properly, please contact me or post a comment.


Inside a comment, write @commenter where commenter is the name of the author you are replying to, followed by a line break, colon, comma and now a dash.

Download latest version of Comment Connection


  1. Copy the folder comment-connection to your WordPress plugin folder (usually wp-content/plugins).
  2. Open the WordPress Admin Panel and activate plugin.


  • Commenter reference must be an exact match of the original author’s name.
  • One database query for every comment with a reference.
  • Only links to the last comment made by the author before the current comment.
  • Author name cannot contain more than 2 spaces.


What is the purpose of this plugin?
Comment Connection allows you to follow conversations that take place in post comments by linking them together automatically.

What symbol triggers the response?
Since version 1.1, both a new line and : activate the plugin.

Will the plugin work if I use a different case?
Yes. Comment Connection will still find the reference if the case is different. Ex. @john smith: will reference the comment by John Smith.


v1.0 –– May 1, 2008
* Initial release

v1.1 –– May 1, 2008
* Added support for using : on the references
* Optimized code to limit the database queries to 1 per comment with a reference

v1.2 –– May 1, 2008
* removed the need for PHP buffer

v1.3 –– May 3, 2008
* changes mode of reference detection
* processes comments with multiple references

v1.4 — May 19, 2008
* update readme file

v1.5 — May 22, 2008
* Added support for comma activation

v1.5.1 — July 28, 2008
* Cleaned up code and readme file

v1.6 — January 6, 2009
* Updated for WordPress 2.7
* Added dash separator

View all plugins
[tags]Wordpress, blog, plugin, comments[/tags]

Posted in Wordpress Tagged with: , , , , ,
24 comments on “WordPress Plugin: Comment Connection
  1. wesg says:

    Sample comment 1

  2. wesg says:


    Sample response

  3. Dave M. says:

    @wesg: So what happens when there are two comments by the same author? How does it know which one to link to? I’m guessing it doesn’t.

  4. Dave M. says:


    So I also have to use a line break to separate the reply name from the rest of the comment. Why is this? Something to do with the code that is used to find the at symbol followed by the name? Hmmm.

  5. wesg says:

    @Dave M.
    At this point the plugin always links to the last comment made before your post. So for example in your comment you say @wesg, you’ll notice that the comment it links to is the last comment I made before yours.

    And yes, right now it uses a line break to find the comments. I hope in the next version, I will be able to add : support as well.

  6. wesg says:

    @impropio: Sample response 2, using version 1.2

  7. Christopher says:


    I quite like this plugin, however, there is one small caveat: The replace function replaces *any* ocurance of the author’s name with a link, not just the first ocurance. Something like str_ireplace("@".$author, '@' . $author . '', $comment) works much better.

  8. Trisha Cupra says:

    @wesg: I have WP 2.5.1 installed, and I’m only getting the first @commenter being linked when I have two @commenters (new paragraph for second one) in one comment.

    @Dave M.: Just testing to see what happens here…

  9. Trisha Cupra says:

    I should have said @wesg and @Dave M.

  10. Trisha Cupra says:

    Wow, you fixed it with the update. Wonderful! Thanks.

  11. Elliott Cost says:

    Pretty cool plugin. Nice job!

  12. willy says:

    @Elliott Cost test

  13. wesg says:

    @willy, there needs to be something after the text to activate the plugin. Though you will notice on my comment that I have added comma support.

  14. phalkunz says:

    @wesg: i find this plugin really cool. I never thought of something like. Great job!

  15. Paradox says:

    Hey, one annoying typo.

    In the code, at line 67, you said “str_ireplace”.

    If a user doesn’t know how to edit this, they may take the errors they will get at face value, and not do anything about it.

    I just remove the i, and it works, but some people, even that is too much.

  16. wesg says:

    Thanks for pointing that out, but that extra i is key to making the plugin work. You’ll notice in my response that Paradox isn’t capitalized, but the replacement still works. Without the i — str_replace — the plugin doesn’t replace words that aren’t the same case.

    For more information, visit http://php.mirror.camelnetwork.com/manual/en/function.str-ireplace.php

  17. meohmy says:

    Cool concept, gonna test it out… thanks!

    @Trisha Cupra: testing…

  18. wesg says:

    @meohmy: Thanks for the comment. I edited it slightly because what you had written wouldn’t trigger the response. Since some names have spaces in them, the plugin looks for a character following your reference (in my case, a colon). With no character following your comment, it would not make the change.

  19. Eric says:

    @wesg: Great !

    Edited by Wes to include an @:D

  20. test says:

    Ye that seems cool

  21. mk says:

    This works with tons of WP versions, just not 2.9.1

  22. juan says:

    in my 2.9.1 not work too

  23. Testperson says:

    @juan: Mal gucken, ob das funktioniert. 😉

Leave a Reply

Your email address will not be published. Required fields are marked *


Twitter: wesgood