Weblog Archive

Closing pingbacks for all posts in Wordpress

Wed, 7 Jun 2006 at 20:17 • Filed under Blog, Noteworthy, Server side

A few posts ago, I mentioned a simple method to turn off comments on all posts in Wordpress, using a very simple SQL query (command) in your web based database administration console, PhpMyAdmin.

In it, I forgot to mention that comment_status can take three status values. They are: open, closed or registered_only.

So, if you want to close all comments in one shot (I am just repeating it here for the sake of completeness):

UPDATE wp_posts SET comment_status="closed";

Open them back again (if you like):

UPDATE wp_posts SET comment_status="open";

Open only to registered users:

UPDATE wp_posts SET comment_status="registered_only";

(Opening older posts only to registered users is a good idea if you get your readers to register. This way, you can keep a close-knit community or a group of regular readers. For these, the comments need not ever close.)

In the same method, you could turn-off or turn-on pingbacks and trackbacks too. The variable to use in this case is: ping_status. This variable takes two types of status values: open and closed (simple and plain english :)).

To close all pingbacks and trackbacks, run this query in PhpMyAdmin:

UPDATE wp_posts SET ping_status="closed";

To open pingbacks and trackbacks to all posts, run this query in PhpMyAdmin:

UPDATE wp_posts SET ping_status="open";

For individual posts, you can always change these again by putting-in or removing a checkmark against allow comments and allow pingbacks. These commands would be useful if you need to do it enmasse for all your posts.

Again, replace the default wp_ table prefix with whatever you’re using in your config.php.

And by the way, this is not rocket science and I am still your average joe. It’s all there in your SQL backup file, if you have ever bothered to open it in a text editor.

But these commands are not possible if you’re using the services of Wordpress.com or Blogsome, because they do not allow you to access the database directly.

This is such a simple switch that I wonder why Wordpress developers have left out from Manage Discussions. In light of excessive spam in recent times, a simple toggle switch (something like “turn off all comments on older posts”, “turn-off all pingbacks in older posts”) within the Wordpress administration console would be really helpful to people battling the ever increasing spam. I just clocked over 13000, by the way!

[ Ads ]

Related posts

Following list is auto-generated, based on this post's context as possibly related. You may, however, occasionally find some in this list unrelated, but nevertheless, we sincerely hope that you'll enjoy them too.

Respond privately

Comments are closed, but you may respond privately to “Closing pingbacks for all posts in Wordpress.” (Your response will not be published.)