Support » Fixing WordPress » spam on pictures?

  • I have Comments turned off for pages and posts.
    But now my Spam folder has 3 comments in it – all on the same image. Not on a post or a page, but an image.
    When I click View Post, it shows me my main page header and then below it, the picture. And below that, a comment box, to leave comments!
    When I click Edit, to see if I can turn off comments, it only takes me to the image properties page.
    I assume that I did not set ‘no comments’ until after I uploaded this particular image … but how does this page come up with a comment box???
    More importantly, how can I turn off commenting on this (and any other) image?

Viewing 13 replies - 1 through 13 (of 13 total)
  • Few realize that a main goal of malware writers is to get website authors to infect websites through their own lack of understanding…The Codex explains in detail how to remove bad files, cleanup the db and prevents this, most of which occurs from home users without proper knowledge of malware…

    The Codex is very big and I have no idea where to look. How about a link?

    saladgoat wrote:

    The Codex is very big and I have no idea where to look. How about a link?

    Sounds like you have trackback spam. Disable all trackbacks. On already created pages you’ll need to uncheck them on an individual basis.

    It’s not trackbacks, it is comments. And the Codex link you provided is helpful for regular spam but not for what I am getting.

    I have all comments and trackbacks turned off.

    If I get spam comments on a post I can go into the Edit page for that post and turn off commenting. I know that.

    These spam are happening to pictures. There is no way that I can see that I can turn off commenting on pictures. When I click to Edit, it takes me to the properties page for that image, which has no option for comments.

    The only useful thing on that Codex page is to delete the wp-comments-post.php file, which is quite drastic and would affect my ability to allow comments in the future, if I chose to. (Wouldn’t this file be restored on every WordPress update? Meaning I would have to delete it every time I updated WordPress?)

    Here is a screenshot of the spam I am getting so you can see what I mean, if I am not explaining it properly.


    That sounded so promising but I am using the Twenty-ten theme and whoever made it put all the good stuff in the loop, where I can’t find it. The attachment file (and, in fact, all the files) are basically:
    leaving nothing to edit. 🙁

    Did you ever get an answer for this?
    I’m having the same problem.

    I never figured it out.
    What happened was that I had set No Comments for the entire site after I had uploaded these images, so only these had commenting allowed.
    By re-uploading the images in questions and deleting these ones, I was able to completely stop spam.
    But that’s really only handy if you have commenting disabled. If you want to allow comments, then I think you’re stuck with spam.

    thanks so much. easy enough to re-upload the image as it’s only one.

    where did you set the “No Comments” for the entire site?

    Go to Settings -> Discussion and uncheck
    Allow people to post comments on new articles

    That will automatically disable commenting on all future posts/pages, etc.
    But you can turn it on for individual posts/pages on the Edit screen.

    thanks very much! I followed your suggestion!

    Best wishes for great digital days (as opposed to ‘digital daze’ where i find myself quite often!)

    Gary Darling


    There is at least one plugin that will fix this problem, Comment Control.

    Alternatively, you can just insert some code in your functions.php file:

    add_filter( 'comments_open', 'no_media_comments', 10, 2 );
    function no_media_comments( $open, $post_id ) {
    	$post = get_post( $post_id );
    // wordpress refers to images as attachments
    	if ( 'attachment' == $post->post_type )
    		$open = false;
    	return $open;

    Test before and after: Go to Media > Library, find an image that has a dark comment bubble, click View and see if there is a comment box.



    Just to say “much appreciated”. Just used the functions.php code in the theme I use – apparently nothing broke and there are no comment boxes on my images. Given I’ve got 500+ of them that should significantly reduce the spam.


Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘spam on pictures?’ is closed to new replies.