Enable or Disable Comments and Pingbacks via SQL

Posted on April 16th, 2011

You can easily remove the trackbacks and pingbacks.

Trackback and pingback spam occurs on posts that have been online for over a month or so, just long enough to be indexed by the search engines and picked up by spammers. Especially for older posts that have managed to acquire a little page rank, the frequency of spam attempts is far greater than it is for fresher content. Throw dofollow comment status into the mix, and say “hello” to a hellish number of spam attempts on established pages. Thus, my evolving anti-spam strategy now includes discussion management, which involves periodic closing of feedback on older posts. In this article, we will examine currently available methods of managing comments.

WordPress includes an easy way to disable or enable discussion throughout your entire site. Simply login to your WP Admin, go to “Options > Discussion”, and toggle the option to “Allow people to post comments on the article”. This setting applies only to future posts and may be overridden on a per-post basis via the “Discussion” options in the “Edit Posts” screen. This method is great for permanently or temporarily disabling future discussion on a sitewide basis.

Regardless of which sitewide discussion option you choose, WordPress makes it possible to override the setting on a per-post basis. Simply open the “Discussion” options in the “Edit Posts” screen, and toggle the comment, pingback and trackback options for that particular post. These settings take precedence over sitewide settings and may be changed at any time. This method is great for disabling or enabling comments and pingbacks on existing content, however would prove far too tedious to implement on any significant number of posts. Nonetheless, post-level discussion management provides authoritative, granular control for existing material.