• Home
  • About John P.
  • Contact
  • Terms

One Man's Blog

Specialization is for Insects.

  • 10 Best
  • Art
  • Computing
  • Fun Stuff
  • Gadgets
  • Videos
  • Photography
  • Travel
  • Tutorials
  • Health & Fitness
  • Politics
  • Thoughts
  • Food
  • Reviews
  • 10 Best
  • Art
  • Computing
  • Fun Stuff
  • Gadgets
  • Videos
  • Photography
  • Travel
  • Tutorials
  • Health & Fitness
  • Politics
  • Thoughts
  • Food
  • Reviews
Home / Photography / How to Disable Comments on All Images in WordPress

How to Disable Comments on All Images in WordPress

John P.

November 1, 2011 By John P.

WordPress has long had a major problem, that has yet to be solved by the development team. Namely, the fact that there is no way to globally disable commenting on certain types of posts or pages – most notably images and media files.

Spammers have been attacking blogs for a very long time and targeting image and media file attachment pages. If you wonder what I mean by that, click on the thumbnail image above. You’ll see that it takes you to a page with a bigger embedded version of the image. Normally, those pages allow you to leave comments (you’ll notice that here on OMB it doesn’t).

Comment Spam on Images

I have been getting hammered with comment spam on images and was looking for a solution for some time, until finally today I came across the Disable Comments plugin.

This video demonstrates the seriousness of the spam comment problem with regards to images. As you can see, the vast majority of spam comments are on image only pages of the site.

5 minutes later, my site was impervious to comment spam on images because this beautiful plugin disable comments on ALL media across the website!

The Hard Way

Now, if you know what you’re doing and you’d rather do it by hand you can run the following MySQL query using PHPMyAdmin or whatever way you like:
UPDATE wp_posts SET comment_status="closed";

But I don’t know why you’d want to do that when the plugin takes care of it for you automatically. Give it a try and enjoy your new spam free image pages plus your faster website since this will deter spammers and decrease the load on your server.

Frankly, I don’t understand why the WP core development team hasn’t added this as a basic feature yet. It would also ease the pain on the Akismet anti-spam service dramatically.

Related

Filed Under: Photography, Tutorials, Wordpress Tagged With: Photography, Photos, Plugins, Tutorials, Wordpress

About John P.

John P. is a former CEO, former TV Show Host, and the Founder and Wizard behind Texas Metal Works. You can find him on Twitter, Facebook and LinkedIn. Feel free to send shoutouts, insults, and praise. Or Money. Money is good.

Comments

  1. Alex T says

    November 26, 2011 at 8:50 am

    John is right, because there are really lots of spammers desperately want some traffics to their site. Thanks for the useful info & I’ll be back for more.

    • prueba says

      April 3, 2013 at 2:48 am

      asdas

  2. fas says

    November 2, 2011 at 7:59 am

    Why use link to attachment, just link directly to images!

John P’s Tweets

Tweets by johnpoz

Read Over 2,500,000 Times

  • How I'd Hack Your Weak Passwords
  • Amusing Little Helicopter Game
  • A Compendium of 150 Monty Python Sketches
  • 10 Worst Drivers Ever Caught On Video
  • Get Your Virtual Haircut and Other Auditory Illusions
  • How Crack Cocaine is Made

Copyright © 2023 · Local Media on Genesis Framework · WordPress · Log in

 

Loading Comments...