Skip to main content
Mass inclusion of comments in Drupal

It happens so that previously there was no need for comments on the site, but then, when you decide to use it after all, you have to go into each material and check the checkbox to include a comment. This is certainly not a problem if the site is a business card, but if it is a site with hundreds or thousands of pages, you need a faster way. SQL queries in MSQL will help us.

So open our database in phpMyAdmin on hosting, click the tab "SQL" and enter the following query:

UPDATE `d7_node` SET comment = 2 WHERE TYPE = 'type';
UPDATE `d7_node_revision` SET comment = 2 WHERE nid IN (SELECT nid FROM d7_node WHERE TYPE = 'type');

Where 'type' is the machine name of the content type (e.g. article) for which we want open comments.


About The Author

Author of this blog. In SEO for over 10 years. In addition to SEO, I am interested in everything related to technology and earnings on the Internet, which I try to share with readers.