• Is there a way to disable comments on images? I’ve looked around the forums and see lots of advice to just disable comments on the post–but (a) that is NOT what I want, and (b) disabling comments on a post that contains an image does NOT disable comments on the image!

    I am using WP 3.0.1 and a child theme (css and header changes) of Twenty ten.

    I moved a site from b2evolution and it immediately began attracting comment spam ON ITS IMAGES only. It would almost appear that some spammers know that WP offers commenting on images that can’t be turned off, or is hard to turn off!

    I’ve installed some anti-spam plugins, which (I hope) will reduce spam comments on images. But I don’t care to offer ANY commenting opportunity on images at all (as apart from the postings into which they are embedded). And, to reiterate: turning off comments on the post does NOT turn off comments on the image.

    I’m hoping somebody knows a trick here that will turn off image comments.

Viewing 5 replies - 1 through 5 (of 5 total)
  • In Twenty Ten, attachment image is displayed using attachment.php template file. If you open the file, at around line 109, there’s a line of code to allow comments:

    <?php comments_template(); ?>
    

    One way to turn off comment completely is by deleting that line of code.

    Thread Starter marthalee

    (@marthalee)

    Hey, great, works perfectly. Thanks!

    Hello,

    I am using a custom template based on Twentyten. My custom template does not use the attachment.php and when I bring it over it messes up the display of the gallery I have. I want to disable comments on images but no matter what if I bring the attachment.php over from twentyten (v 1.1) and put it in my themes folder it messes up. Therefore, if I take out the “<?php comments_template(); ?>” it messes up. I’m trying to take out comments on all photos (just photos not other posts). Can anyone help? Please let me know if you need any other information.
    wordpress 3.0.4

    Quick addition to the above statement:

    Using heavily cutomization of sandbox theme. So, within the theme there is no image.php, attachment.php. There is the function.php which is where I’m thinking it might be….?

    The “comment_status” and “ping_status” fields for an attachment are set when you create it. Even if you later change the “Allow comments by default” that only affects new attachments.

    I just wrote a tiny plugin called private-attachments that lets you disable comments and pings for attachments, and even lets you temporarily disable an attachment without deleting it… Yes, this actually changes the comment_status, ping_status, and post_status for attachments right in the WP database. Give it a try.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘disable comments on images?’ is closed to new replies.