How can I exclude some entities in "drush entity:delete" command? I want to delete all content of custom entity type except some specific items, I found drush entity:delete CUSTOM_TYPE command to delete all contents but couldn't exclude some items from deletion in this command, does it have any option like --exclude ID1, ID2, ID3, ...?

Or is there any other way to do this?
ok mate you want other options and here is the answer:

if you look at 

vendor/drush/drush/src/Drupal/Commands/core/EntityCommands.php

you can see the what the function does....

now you need to learn how to make a custom drush commands i assume you are using drush 9  so you can just run:

"drush  generate drush-command-file"

or read: https://www.axelerant.com/resources/team-blog/how-to-write-custom-drush-9-commands-for-drupal-8

this will create:
modules/custom/YOURMODULE/drush.services.yml
and 
modules/custom/YOURMODULE/src/Commands/YOURMODULECommands.php

now have a look at the following working example ...

&lt;?php
/**
 * Command delete some stuff
 *
 * @param $entity_type
 *   Argument for entity type.
 * @param $exclude
 *   Argument for exclude delete of ids.
 *
 * @param array $options
 *   An associative array of options whose values come from ...
 *
 * @option option-name
 *   Description
 * 
 * @usage deletethings-commandName foo
 *   Usage description
 *
 * @command deletethings:commandName
 * @aliases delete-my-stuff
 */
 public function commandName($entity_type, $exclude,  $options = ['option-name' =&gt; 'default']) {
$this-&gt;logger()-&gt;success(dt($entity_type));
$this-&gt;logger()-&gt;success(dt($exclude));
$exclude_ids= [];
if ($exclude !== 'none') {
  $exclude_ids = explode(',', $exclude);
}


// now do the delete stuff
$storage = \Drupal::entityTypeManager()-&gt;getStorage($entity_type);
if (is_object($storage)) {
  $all = $storage-&gt;loadMultiple();
  if (count($all) !== 0) {
    foreach ($all as $entity) {
      $id = $entity-&gt;id();
      if (!in_array($id, $exclude_ids)) {
        // kill with fire.
        $entity-&gt;delete();
      }
    }
  }
}
}


With that you can run:

drush  delete-my-stuff ENTITY_TYPE 5,6,10

example: drush  delete-my-stuff node 5,6,10

this would then allow you to delete all items of your entity except for "5,6,10" - which are ids you want to keep 

or drush  delete-my-stuff ENTITY_TYPE none (to delete all) 

remember to run drush cr and drush cc (1) so drush will recognise the new command