I have a drupal 9.1.5 site with a custom node type. I can create test content for it using drush by running;

drush genc 1 --bundles=mynode --authors=test

However, half of the content has comments disabled. I think what is happening is that drush is randomly settings the COMMENT SETTINGS field:

enter image description here

Drush has a --skip-fields parameter, but I don't know what to put in there. I've tried a bunch of different things like field_mynode_comment (the machine name of the field) but none seemed to work. I'm basically guessing.

How can I use drush to create nodes that always allow comments?

  • Did you try with devel generate ? Commented Mar 25, 2021 at 16:39
  • 2
    @miststudent2011 – drush genc is Devel Generate.
    – leymannx
    Commented Mar 25, 2021 at 18:17

1 Answer 1


This is more of a workaround;

I can coerce all nodes to enable comments by running a query like this:

drush sql-query "UPDATE node__field_mynode_comment SET field_mynode_comment_status = 2"

I had a look at the database and found the node__field_mynode_comment table, which has a field_mynode_comment_status column. I found that the nodes with that column set to 2 had comments enabled, so I ran the above query to set it for all nodes, and now all nodes have comments enabled.

Incidentally I also tried creating the nodes with that field name ignored (--skip-fields=field_mynode_comment_status) but that didn't seem to have any effect.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.