Welcome to Dagon Design. In addition to free scripts, WordPress plugins, and articles, we offer a variety of services including custom theme design, plugin creation, and PHP scripting. Contact me for more information.

Version 1.2   Updated Sunday, February 22nd, 2009 at 4:16pm

Report Comments Plugin for WordPress

This plugin provides a way for visitors to report inappropriate comments on a WordPress powered site. It does this by automatically adding a link to each comment, which (after asking for confirmation) notifies the administrator by email. There are several options available, including customization of the text, the email message generated (you can choose to include the post title, url, date, author, etc..), and more. Now supports Recaptcha image verification.

Download

  If you have found this page useful, please consider donating. Thanks!

Installation

  • Download and unzip the above file
  • Upload the entire dd-report-comments directory to your plugins directory
  • Activate the plugin from the WordPress admin panel
  • Configure the options under the admin panel: Options – DDReport

Usage

Once activiated, links are added to the comments automatically. The only option you must change is your email address. Other options are available as well, and are explained below.

Change Log

  • 02-22-09 Version 1.2 – Now uses a popup window to report comments. Recaptcha image verification support added, and a few other options. See updated options list below.
  • 06-20-07 Version 1.1 – Added an optional textarea so the personal reporting the comment can include a message.
  • 06-16-07 Version 1.0 – First release.

Options

Link Display Options

Link text – The text shown for the link.

Code before/after link – This allows you to add code around the link for formatting. The default option wraps the link in p tags aligned to the right.

Open in new window – If checked, the confirmation pages will open in a new window.

Email Options

Email address – Where the notifications are sent.

Email subject & message – These options are used to generate the email. You can use the pre-defined tags for this:

%COMMENT_ID% – The ID number of the comment
%COMMENT_URL% – The URL of the comment
%POST_ID% – The ID of the post
%POST_URL% – The URL of the post
%POST_TITLE% – The title of the post
%COMMENT_AUTHOR% – The author of the comment
%COMMENT_DATE% – The date of the comment
%COMMENT_TEXT% – The comment text
%VISITOR_COMMENT% – Optional message from the person reporting this comment

Recaptcha Options

If you do not want to use image verification, leave these options blank.

Otherwise, enter your Recaptcha public and private key (for your domain). If you do not have a Recaptcha account, you can sign up for free at http://recaptcha.net/whyrecaptcha.html

Confirmation Page Options

Confirmation text – The text shown on the confirmation page.

Confirmation button – The text shown on the confirmation button.

Success message – The text shown to the user after the notification has been sent.

Validation error message – If using the Recaptcha image verification option, this is the message that will be shown if the code is not entered properly.

Popup width – The width of the popup window.

Popup height – The height of the popup window.

Troubleshooting

Some servers are configured to only allow PHP to send mail to an email address on the server itself. If you do not receive email sent from this script, try using an email address on the same domain.

Get IP and hostname of form submitters

Open up report.php, and look for this line:

mail($addr, $subject, $msg, 'From: ' . get_option('admin_email'));

Before it, add this:

$msg .= "\n\n" . 'IP: ' . $_SERVER['REMOTE_ADDR'] . "\n" . 'HOST: ' . 
gethostbyaddr($_SERVER['REMOTE_ADDR']) . "\n\n";

And the IP address and hostname of the person who submitted your form will be at the bottom of the email message.

  1. I have a simple request for this great plugin. Can you make it so that users have to be logged in to report a comment? This is to help prevent spam and instead of getting the ip i would get the username…please email me at my site email provided asap. Thanks for your time.

  2. 43
    Kruben Chung

    Great plugin and I like it, installed it it on my WP 2.8.4, looked great and worked wonders, but had to deactivate it because it places ALL comments onto moderation and now I have to baby-seat my site. I get tons of comments and putting everything under moderation is no option at all. Same problem as Ben in comment #41

    Does any know how to disable this feature? Great plugin otherwise.

  3. 42
    neologan

    i second the use of thickbox, if you can get it working :)

    would also like to know how i can turn off auto placement so i can do it myself, and what the code would be.

    thanks.

  4. We’ve found all of the comments have been placed in the pending folder following adding this plugin. Has anyone else found that? How do we stop it?

  5. very nice sites thanks

  6. This plugin has been tested, and works, with the latest release of WordPress – 2.8

    I will certainly keep your suggestions in mind for future releases.

  7. 38
    Jean-Paul Horn

    Is it possible to remodel the popup into a Thickbox modal dialog (since it’s already loaded with WordPress)? Tried this myself, but couldn’t find the exaxt code :-(

  8. Very exceptional pieces of information. Very nice webpage though. I applaud

  9. 36
    sota

    is there any way to change font of the link (Report comment)
    thank you,

  10. 35
    Craig

    Great plugin, I can’t believe no one else had ever done this before!

    Could you please let me know if it is possible to disable the automatic insertion of the code – as I would like to call the plugin myself after wrapping it nicely in a styled div at the very bottome of each comment. Yes, I use a custom comments loop :-D

    Thanks!

  11. 34
    Roar

    Oh my god, thank you so much. With some posts getting 400 comments, it will be good if people can report fights.

  12. What a great plugin and exaccly what i’ve been looking for. One question though. Any idea how i’d put a wrapper around it so a comment can only be reported once? I have 50,000 odd readers & it would be worse than spambots if they all took objection to a comment at the same time.

  13. Mike R: I just added instructions on how to do so at the bottom of the page. Enjoy!

  14. 31
    Mike R

    Hey guys,

    I have been using this for a couple of months now and it does what it says on the tin. What I could *really* do with is having the IP address of the person reporting the comment included in the report.

    Is there an easy way I could add a line to the code to get it to do this? I’m no coder but can edit if someone can give me the code and the place :)

  15. Hi there!

    How can i move the “Report link” to another position in the comments. Now the link is in the bottom/end of the comment text but i want it to appear in the end of the line whit the author and time for the post. Look on this post on my page http://www.larm-soderhamn.se/?p=2874 . The report link is now in the end and is named (Anmäl denna kommentar).

    Regards Daniel S

  16. Version 1.2 Released

    When a link to report a comment has been clicked, the form now opens in a popup window. Support for Recaptcha image verification has been added as well (if you choose to use it). This helps prevent spam bots from trying to submit the form.

    For those of you unfamiliar with Recaptcha, all you have to do is sign up for a free account for your website (info is above, and in the plugins options page).

    Other options have been added to specify the error message shown when the code is not entered properly, and to define the width and height of the popup window.

    This plugin has been tested in the latest release of WordPress (2.7.1)

  17. Does this plugin work with WP 2.7?

  18. Hi
    I need something like this. I need a post reporter. or a link under codes (CODES) for reporting dead links.

    Thank you anyway…

  19. I had the same problem as Martin, it worked great in FireFox but in IE7 I clicked the link to report a comment and it gave me a page not found error. I love the functionality but if it doesn’t work with IE that’s a big problem.

  20. 25
    jackburton

    great plugin! i’m using it extensively on one of my sites. the problem is, i’m now getting SPAM REPORTS! yes, that’s right, from spam bots using the link to spam me. is there any way to prevent this? like include a captcha-like addition in any upgrades so only a human being can use it? thanks, and again, great plugin!

  21. 24
    Andrew

    Can we have this updated for 2.5? Its such a cool idea!

  22. 23
    Martin

    It doesnt work with IE someone know why? … Te (Report Comment) apears but if u press it the page has an error….

  23. 22
    Martin

    Hi, this is a great plugin im traing to use it on WP MU . Is it posible to chanche the Email address for each blog en WP . i.e. Send the mail to a diferent modarator for each blog.

  24. Needs “captcha” added bad. Any chance you guide me through adding captcha to the plugin?

    Great plugin just the same.

  25. I modified your code with a simple spam avoidance field. Adding in a captcha or something similar to what I did (you can see it at profootballtalk.com) will significantly decrease emails to admins on popular sites.

  26. Nice plugin that i’ve adapted to suit my site, is there any way of incorporating the page with my blog template? It looks a little out of place at the moment.

    (I know i could drop the form into a hacked version of my template but am looking a straightforward solution.)

  27. thanks man, but how to do this for posts??

  28. Hi friend,

    I really appreciate what you have done. It’s great. Can you please code the plugin which do the same thing so that visitor can report a post on my site which is not working.

    I am waiting for ur reply.

    Thanks a lot for your support.

    Regards,
    GP.

  29. 16
    Alex

    Does anyone know if this works with WP 2.5?

  30. 15
    Leland

    Sorry if this is a stupid question: would it be hard to convert this into a “Report Post” plugin? Useful for blogs that allow registered users to post.

  31. …If it was set up that way, anytime search engine robots followed the link, etc.. it would trigger emails.

    Why not just add rel=”nofollow” to the links?

  32. Hi, could the plugin be set up to send the IP address of the person who reports the post in the email to the blog admin. This would assist in dealing with those who wish to abuse the facility of reporting posts.

  33. Dave: If it was set up that way, anytime search engine robots followed the link, etc.. it would trigger emails.

  34. 11
    Dave

    I would much prefer if this link just fired of a generic email and then displayed a success message. I hate the way it take you to a big ugly empty page that it completely outside of the normal blog interface. This needs to somehow stay within the blog interface. Please not that new windows are not good usability… and even if you do use the new window option… a user could have their browser configured to open all new windows in a tab… which makes for an even worse user experience.

  35. I am having trouble using this plugin. I keep getting an error message when i try to update the options page in admin. Here is the error:

    
    Fatal error: Cannot redeclare ddrc_add_option_pages() (previously declared in D:\xxxx\xxxx\mydomain.com\wp-content\plugins\dd-report-comments\dd-report-comments.php:38) in D:\xxxx\xxxx\mydomain.com\wp-content\plugins\dd-report-comments\dd-report-comments.php on line 37

  36. Nice plugin, but I suggest to put the Report link in the meta line near the comment author’s name. Also, you may want to use icon instead of the Report word, which is irritating when repeated in hundreds of comments.
    The plugin also breaks rss feed on one of my blogs. The plugin error is shown on the top of the feed:

    Warning: Cannot modify header information – headers already sent by (output started at /var/www/vhosts/DOMAIN/public_html/BLOG/wp-content/plugins/dd-report-comments/dd-report-comments.php:1) in /var/www/vhosts/DOMAIN/public_html/BLOG/wp-includes/feed-rss2.php on line 2

  37. Awesome! Thanks but i wanna change the place of (report comment). How can i edit it and i wanna open window in javascript. is it hard to change?

  38. Hm, actually I’ve started to get some spam sent in through the report form. Is it possible to maybe have a captcha or some sort of spam protection on it enabled?

  39. Just wanted to say that this is an awesome plugin and I’ve installed it on my blog now. Thanks a bunch!

  40. Very good plugin. I am using it at my website. But the textarea is becoming a good place for spammers. I am getting some 15 emails per day, that don’t have any legitimate complaints but only spam.

    Would be good to add a function to not accept reports with URLs in the textarea.

  41. 4
    Camner

    This sounds like a great plugin. Unfortunately it appears to be incompatible with another plugin I use, WP AJAX Edit Comments. There are other comment editors, so I may look about.

  42. Version 1.1 has been released. It adds a textarea so the person reporting the comment can add an optional message.

    NOTE – if you are upgrading from 1.0, be sure to load the default options (using the button on the options page), because a few of the default option values have changed.

  43. Johan: Support for other character sets is something I plan to look into (for several of my scripts/plugins), but at the moment they are not fully supported.

    Your idea to allow the user to add a comment to the report is very good though – I will add that in with the next release.

  44. 1
    Johan

    Great plugin! Two observations: 1. My blog is in swedish and Ã¥, ä and ö does not show, instead I get wieard letters like: “Är det fler än jag” in the report-mail. 2. Is it posible to let the user that reports a comment get the choise to write a word or two about the reson for reporting?

Leave a Comment

Before you comment: If you are having an issue with a script, please make sure you have read the entire article. Also, please read through the comments because most common issues have already been discussed many times. Thanks.


Be sure to wrap all code in <code></code> tags.