WP-CLI allows developers to use the WP-CLI command line tool to carry out tasks like adding or removing users, posts, changing categories, updating plugins, and more. Follow these instructions below to use Disable Comments plugin commands with the WP-CLI command line tool to perform tasks like changing the plugin settings and deleting comments.
How To Install and Activate Disable Comments Plugin via WP-CLI? #
To install and activate Disable Comments plugin via WP-CLI, run the command given below:
wp plugin install disable-comments --activate
How To Configure Settings For Disable Comments Plugin via WP-CLI? #
To configure your settings in Disable Comments via WP-CLI, first, run the command given below:
wp help disable-comments settings
Afterward, enter the commands that you need to run to change your settings in Disable Comments. Some examples are given below.
- To disable comments everywhere on your website, run the command:
wp disable-comments settings --types=all
- To disable comments on WordPress posts, run the command:
wp disable-comments settings --types=post --add
- To enable comments on WordPress post type (page), run the command:
wp disable-comments settings --types=page --remove
- To disable comments via REST API, run the command:
wp disable-comments settings --xmlrpc --rest-api
- To allow comments via REST API, run the command:
wp disable-comments settings --xmlrpc=false --rest-api=false
- To enable avatar, run the command:
wp disable-comments settings --disable-avatar=0
- To disable avatar, run the command:
wp disable-comments settings --disable-avatar
How To Delete Comments Using WP-CLI? #
Disable Comments lets you permanently delete comments from your WordPress website with the ‘Delete Comments’ option. You can access the help guide for this option by running the following command:
wp help disable-comments delete
Note: Deleting comments will permanently remove them from your website and cannot be recovered without a database backup
Next, enter the commands that you need to run to delete comments from your WordPress website via WP-CLI. Some examples are given below.
- To delete comments everywhere on your website, run the command:
wp disable-comments delete --types=all
- To delete comments on WordPress posts, run the command:
wp disable-comments delete --types=post
- To delete comments on custom post types, run the command:
wp disable-comments delete --types=post --extra-post-types=contact
- To delete comments on several comment types (ie. comment, pingback, trackback), run the command:
wp disable-comments delete --comment-types=comment
- To remove all spam comments, run the command:
wp disable-comments delete --spam
By following the above guidelines you use Disable Comments plugin with the WP-CLI command line tool.
If you face any difficulties, feel free to contact our support team or join our Facebook Community.