Community Documentation

Disable or enable comments for node types en mass

Last updated September 11, 2009. Created by glass.dimly on September 11, 2009.
Log in to edit this page.

This snippit allows you to bulk enable or disable comments for nodes through the database.

SQL to disable comments for all nodes of type "story":
UPDATE node SET comment = 0 WHERE type LIKE "story";

comment = 2 would mass enable read/write
comment = 1 would mass enable just read
You can change "story" to "page" or whatever you'd like.

Comments

thanks

that is exactly what I need

Bevin

Well, yes. But...

Well, yes. But...
-- Would love to provide a UI to choose a large number of nodes, but not all of a type.
-- I prefer not to do this kind of thing in production.

D7

About this page

Drupal version
Drupal 5.x, Drupal 6.x
Audience
Developers and coders, Site administrators

Reference

Drupal’s online documentation is © 2000-2012 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License.