Skip to main content

Drupal 8: Cannot uninstall comment module - Fields pending deletion

How to uninstall the comments module in drupal 8 and get rid off the "fields pending deletion" message when you run drush pm:uninstall comment ?

If you run

drush pm:uninstall comment

you will get an error message like this 

comment: The <em class="placeholder">Comments</em> field type is used in the following fields: node.comment, node.comment_node_article, node.comment_node_page    

First you have to delete all the comment reference fields from all the entities that are using the comment entity as a reference field.

drush php-eval 'field_purge_batch(500);'

and finally

drush pm:uninstall comment

You are done :)

Latest Articles

VSCode Drupal Coding Standards Setup (From Scratch) admin_pixelthi… Mon, 12/22/2025 - 16:01 VSCode Drupal Coding Standards Setup (From Scratch)

VSCode Drupal Coding Standards Setup (From Scratch)

vscode
Using drupal/core-composer-scaffold to prevent rewriting .htaccess or robots.txt file admin_pixelthi… Sun, 12/01/2024 - 16:49 Using drupal/core-composer-scaffold to prevent rewriting .htaccess or robots.txt file

Using drupal/core-composer-scaffold to prevent rewriting .htaccess or robots.txt file

composer
Controlling ckeditor styling options with hook_editor_js_settings_alter admin_pixelthi… Thu, 05/16/2024 - 10:49 Controlling ckeditor styling options with hook_editor_js_settings_alter

Controlling ckeditor styling options with hook_editor_js_settings_alter

php hook hook_editor_js_settings_alter hook_field_widget_single_[WIDGET_TYPE]_form_alter