I have about a hundred posts on my drupal installation.

How do I go back and enable comments for all of those?

Thanks...

Comments

dshaw’s picture

I haven't seen a way to do this through the admin menu. The obvious spot to look (admin >> content >> node) does not offer this feature.

It wouldn't be hard to do using SQL on the underlying database if you have some knowledge in this area. A quick guess at this would be (and please note I only gave this a quick test under phpMyAdmin)

update node set comment = 2 where nid in (1, 2, 3, 4)

Replace the (1, 2, 3, 4) with the node-ids of the nodes you wish to change.

dshaw’s picture

And if you want to change ALL your nodes:

update node set comment = 2;

t1s’s picture

Thank you, this saved me a ton of time

gorgonites’s picture

is there a way to do this to only certain node-types?

ryanc’s picture

update node set comment = 2 where type = "page";

boxfire’s picture

i know it's old but thanks, just perfect!

theusualsuspect’s picture

Thank you so much. I was trying out Views Bulk Operations. Thank God I found this post. Saved me going trough every node to manually activate the comments.

Its the little things...

christopherareed’s picture

I've come back to this thread a few times now, I never use SQL and I can never seem to remember the proper syntax.

I agree it most certainly is the little things.

Anonymous’s picture

:) obviously ... thx

olisb’s picture

That worked a charm - Thank you.

3rdLOF’s picture

This will not work if your node has beed edited, thus generating a node revision.

If so, you need to run this query on the "node_revision" table. Not sure if "as well as in the node" table, but doing it only on the node will not work.

Peace.

EDIT: In this case the "type" does not exist.

lupus78’s picture

this work on Drupal 7:

UPDATE node as n LEFT JOIN node_revision as nr ON nr.nid=n.nid AND nr.vid=n.vid 
SET
n.comment = 2,
nr.comment = 2
WHERE n.type = '*your_node_type*'