Skip to content

Instantly share code, notes, and snippets.

@nkgokul
Created August 5, 2015 11:30
Show Gist options
  • Save nkgokul/626f7de19ac7a7a5146e to your computer and use it in GitHub Desktop.
Save nkgokul/626f7de19ac7a7a5146e to your computer and use it in GitHub Desktop.
For all content types in drupal
#!/bin/bash
drush sqlq "select type from node_type" | while read content_type;
do
echo "Changing comment settings for $content_type"
drush vset comment_default_mode_$content_type 0
drush vset comment_default_per_page_$content_type 50
drush vset comment_$content_type 2
drush vset comment_form_location_$content_type 1
drush vset comment_preview_$content_type 0
drush vset comment_subject_field_$content_type 0
# or do whatever with individual element of the array
done
@asifnoor
Copy link

asifnoor commented Aug 6, 2015

Great job Gokul. Tested and worked well. I am sure, it will save lot of time especially when there are many content types. People can take cue from this script and can expand it to do many other such time taking things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment