Disable comments plugin

This plugin is stated as compatible with WP >= 5 (so CP incompatible). Even if the code checks for WP < 4.7 to refuse activation.
This is another plugin that you can live without.
Here there is a bash script that, using wp-cli, that fixes things (a good part).
Just adjust MYPATH and pass to the script the site you want to work on (this is based on Plesk/CentOS).

#!/bin/sh

MYPATH="--path=/var/www/vhosts/"$1"/httpdocs"

MYOPTIONS="
   'comment_moderation' '1'
   'default_comment_status' 'closed'
   'default_pingback_flag ' '0'
   'default_ping_status' 'closed'
"

OLDIFS=$IFS;
IFS=$'\n';
for OPT in $MYOPTIONS
do
   eval "wp --allow-root option set $OPT $MYPATH"
done
IFS=$OLDIFS

wp --allow-root post list --format=ids --post_type=any $MYPATH | xargs \
	wp --allow-root $MYPATH post update --comment_status=closed


wp --allow-root post list --format=ids --post_type=any $MYPATH | xargs \
	wp --allow-root $MYPATH post update --ping_status=closed

Hope this can help someone.

5 Likes