Drupal コメント機能を停止する

  • Posted on: 3 February 2019
  • By: admin

node types 一覧

$ drush sql-query "SELECT DISTINCT type FROM node ORDER BY type"

コメントが有効な node type

$ drush sql-query "SELECT DISTINCT type FROM node WHERE comment <> 0 ORDER BY type"

コメントが有効な node の title

$ drush sql-query "SELECT title, type, comment FROM node WHERE comment <> 0 ORDER BY type"

特定のコンテンツタイプについて、コメントを disable

$ drush sql-query "UPDATE node SET comment = '0' WHERE type = 'story';"
$ drush sql-query "UPDATE node_revision SET comment=0 WHERE nid IN (SELECT nid FROM node WHERE node.type='story');"