{"id":9150,"date":"2010-05-14T11:43:15","date_gmt":"2010-05-14T11:43:15","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/safe-report-comments\/"},"modified":"2026-08-20T00:59:53","modified_gmt":"2026-08-20T00:59:53","slug":"safe-report-comments","status":"publish","type":"plugin","link":"https:\/\/sah.wordpress.org\/plugins\/safe-report-comments\/","author":5279457,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"0.5.0","stable_tag":"0.5.0","tested":"7.0.4","requires":"6.4","requires_php":"7.4","requires_plugins":null,"header_name":"Safe Report Comments","header_author":"Thorsten Ott, Daniel Bachhuber, Automattic","header_description":"","assets_banners_color":"","last_updated":"2026-08-20 00:59:53","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/wordpress.org\/plugins\/safe-report-comments\/","header_author_uri":"https:\/\/automattic.com","rating":3,"author_block_rating":0,"active_installs":200,"downloads":28433,"num_ratings":7,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","changelog"],"tags":{"0.3":{"tag":"0.3","author":"danielbachhuber","date":"2012-11-08 00:00:34"},"0.3.1":{"tag":"0.3.1","author":"danielbachhuber","date":"2013-01-17 00:39:57"},"0.3.2":{"tag":"0.3.2","author":"danielbachhuber","date":"2013-03-07 19:24:41"},"0.4":{"tag":"0.4","author":"batmoo","date":"2014-07-23 21:13:47"},"0.4.1":{"tag":"0.4.1","author":"automattic","date":"2018-11-30 07:00:12"},"0.5.0":{"tag":"0.5.0","author":"automattic","date":"2026-08-20 00:59:53"}},"upgrade_notice":[],"ratings":{"1":"3","2":0,"3":"1","4":0,"5":"3"},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["0.3","0.3.1","0.3.2","0.4","0.4.1","0.5.0"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":3655566,"resolution":"1","location":"assets","locale":"","width":956,"height":336},"screenshot-2.png":{"filename":"screenshot-2.png","revision":3655566,"resolution":"2","location":"assets","locale":"","width":890,"height":241},"screenshot-3.png":{"filename":"screenshot-3.png","revision":3655566,"resolution":"3","location":"assets","locale":"","width":422,"height":341},"screenshot-4.png":{"filename":"screenshot-4.png","revision":3655566,"resolution":"4","location":"assets","locale":"","width":650,"height":346}},"screenshots":[]},"plugin_section":[],"plugin_tags":[107,14005,21021,21022,599],"plugin_category":[44,54],"plugin_contributors":[77494,77514,78161,78260],"plugin_business_model":[],"class_list":["post-9150","plugin","type-plugin","status-publish","hentry","plugin_tags-comments","plugin_tags-flagging","plugin_tags-inappropriate","plugin_tags-report-comments","plugin_tags-spam","plugin_category-discussion-and-community","plugin_category-security-and-spam-protection","plugin_contributors-automattic","plugin_contributors-danielbachhuber","plugin_contributors-garyj","plugin_contributors-tott","plugin_committers-automattic","plugin_committers-batmoo"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/safe-report-comments.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/safe-report-comments\/assets\/screenshot-1.png?rev=3655566","caption":""},{"src":"https:\/\/ps.w.org\/safe-report-comments\/assets\/screenshot-2.png?rev=3655566","caption":""},{"src":"https:\/\/ps.w.org\/safe-report-comments\/assets\/screenshot-3.png?rev=3655566","caption":""},{"src":"https:\/\/ps.w.org\/safe-report-comments\/assets\/screenshot-4.png?rev=3655566","caption":""}],"raw_content":"<!--section=description-->\n<p>This plugin gives your visitors the possibility to report a comment as inappropriate. After a set threshold is reached the comment is put into moderation where the moderator can decide whether to approve it. If a comment is approved by a moderator it will not be auto-moderated again while still counting the amount of reports.<\/p>\n\n<h3>Customizations<\/h3>\n\n<p>By default this plugin should work with most existing themes without any changes. It appends the flagging link to each comment and then, in the browser, moves it next to that comment's reply link. The reply link is located via its core <code>data-commentid<\/code> attribute, so placement does not depend on your theme's specific markup.<\/p>\n\n<p>The report link ships unstyled and inherits your theme's link styles from wherever it appears, so it can look different next to a reply link than at the end of a comment (the deepest threading level, which has no reply link). To adjust or unify its appearance, target the <code>.safe-comments-report-link<\/code> class in your theme's CSS.<\/p>\n\n<p>If you would rather control the placement yourself, you can place the flagging link manually. Define <code>no_autostart_safe_report_comments<\/code> in your theme's <code>functions.php<\/code> file and initialize the class with auto-attachment disabled: <code>$safe_report_comments = new Safe_Report_Comments( false );<\/code>.<\/p>\n\n<p>Here is an example of a custom setup in <code>functions.php<\/code> that places the flagging link via a comment callback function.<\/p>\n\n<p>In <code>functions.php<\/code>:<\/p>\n\n<pre><code>\/\/ Flag comments plugin included in theme's functions.php - disable plugin.\ndefine( 'no_autostart_safe_report_comments', true );\ninclude_once( 'replace-with-path-to\/safe-report-comments\/safe-report-comments.php' );\n\/\/ Make sure not to auto-attach to the comment reply link.\n$safe_report_comments = new Safe_Report_Comments( false );\n\n\/\/ Change link layout to have a pipe prepended.\nadd_filter( 'safe_report_comments_flagging_link', 'adjust_flagging_link' );\nfunction adjust_flagging_link( $link ) {\n    return ' | ' . $link;\n}\n\n\/\/ Adjust the text to \"Report abuse\" rather than \"Report comment\".\nadd_filter( 'safe_report_comments_flagging_link_text', 'adjust_flagging_text' );\nfunction adjust_flagging_text( $text ) {\n    return 'Report abuse';\n}\n<\/code><\/pre>\n\n<p>In your custom comment callback function used by <a href=\"https:\/\/developer.wordpress.org\/reference\/functions\/wp_list_comments\/\"><code>wp_list_comments<\/code><\/a>, place the following action, which prints the link:<\/p>\n\n<pre><code>&lt;?php do_action( 'comment_report_abuse_link' ); ?&gt;\n<\/code><\/pre>\n\n<p>A possible callback function could look like this:<\/p>\n\n<pre><code>function mytheme_comment( $comment, $args, $depth ) {\n    $GLOBALS['comment'] = $comment; ?&gt;\n    &lt;li &lt;?php comment_class(); ?&gt; id=\"li-comment-&lt;?php comment_ID() ?&gt;\"&gt;\n        &lt;div id=\"comment-&lt;?php comment_ID(); ?&gt;\"&gt;\n            &lt;div class=\"comment-author vcard\"&gt;\n                &lt;?php echo get_avatar( $comment, $size = '48', $default = '&lt;path_to_url&gt;' ); ?&gt;\n                &lt;?php printf( __( '&lt;cite class=\"fn\"&gt;%s&lt;\/cite&gt; &lt;span class=\"says\"&gt;says:&lt;\/span&gt;' ), get_comment_author_link() ) ?&gt;\n            &lt;\/div&gt;\n            &lt;?php if ( $comment-&gt;comment_approved == '0' ) : ?&gt;\n            &lt;em&gt;&lt;?php _e( 'Your comment is awaiting moderation.' ) ?&gt;&lt;\/em&gt;\n            &lt;br \/&gt;\n        &lt;?php endif; ?&gt;\n        &lt;div class=\"comment-meta commentmetadata\"&gt;&lt;a href=\"&lt;?php echo htmlspecialchars( get_comment_link( $comment-&gt;comment_ID ) ) ?&gt;\"&gt;&lt;?php printf( __( '%1$s at %2$s' ), get_comment_date(), get_comment_time() ) ?&gt;&lt;\/a&gt;&lt;?php edit_comment_link( __( '(Edit)' ), '     ', '' ) ?&gt;&lt;\/div&gt;\n\n        &lt;?php comment_text() ?&gt;\n\n        &lt;div class=\"reply\"&gt;\n            &lt;?php comment_reply_link( array_merge( $args, array( 'depth' =&gt; $depth, 'max_depth' =&gt; $args['max_depth'] ) ) ) ?&gt;\n        &lt;\/div&gt;\n        &lt;div class=\"report-abuse\"&gt;\n            &lt;?php do_action( 'comment_report_abuse_link' ); ?&gt;\n        &lt;\/div&gt;\n    &lt;\/div&gt;\n    &lt;?php\n}\n<\/code><\/pre>\n\n<p>There are various other actions and filters within the plugin that allow you to alter its behaviour. Please see the inline documentation for details.<\/p>\n\n<h3>Notes<\/h3>\n\n<p>At the maximum threading depth WordPress does not render a reply link, so in automatic mode the flagging link stays at the end of the comment rather than moving next to a reply link. The link still works as normal. Earlier versions attached to the reply link itself and so showed no flagging link at all at this depth.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Download and unzip the plugin.<\/li>\n<li>Copy the <code>safe-report-comments<\/code> directory into your plugins folder.<\/li>\n<li>Visit your Plugins page and activate the plugin.<\/li>\n<li>A new checkbox called \"Allow comment flagging\" will appear on the <strong>Settings \u2192 Discussion<\/strong> page.<\/li>\n<li>Activate the flag and set the threshold value, which appears on the same page once flagging is enabled.<\/li>\n<\/ol>\n\n<!--section=changelog-->\n<p>The full changelog is maintained in <a href=\"https:\/\/github.com\/Automattic\/safe-report-comments\/blob\/develop\/CHANGELOG.md\">CHANGELOG.md<\/a>.<\/p>","raw_excerpt":"This plugin gives your visitors the possibility to report a comment as inappropriate. After a set threshold is reached the comment is put into moderat &hellip;","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/sah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/9150","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/sah.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/sah.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=9150"}],"author":[{"embeddable":true,"href":"https:\/\/sah.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/automattic"}],"wp:attachment":[{"href":"https:\/\/sah.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=9150"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/sah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=9150"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/sah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=9150"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/sah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=9150"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/sah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=9150"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/sah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=9150"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}