commit 10f88cd611ab03a60244e8269dc78888e75e0ac2
Author: Andy Postnikov <apostnikov@gmail.com>
Date:   Sat Oct 8 14:28:19 2016 +0300

    patch 2

diff --git a/drush/default_content.drush.inc b/drush/default_content.drush.inc
index c062ca2..4b50160 100644
--- a/drush/default_content.drush.inc
+++ b/drush/default_content.drush.inc
@@ -29,6 +29,7 @@ function default_content_drush_command() {
     ],
     'options' => [
       'folder' => dt('Folder to export to, entities are grouped by entity type into directories.'),
+      'skip-core-users' => dt('Do not export user entities created by core'),
     ],
     'aliases' => ['dcer'],
     'required-arguments' => 1,
@@ -79,20 +80,55 @@ function drush_default_content_export_references($entity_type_id, $entity_id = N
   $manager = \Drupal::service('default_content.manager');
 
   $folder = drush_get_option('folder', '.');
+  // @todo Set this option default to TRUE or bypass to manager.
+  $skip_core_users = drush_get_option('skip-core-users', FALSE);
   if (is_null($entity_id) && ($entities = \Drupal::entityQuery($entity_type_id)->execute())) {
     // @todo Add paging.
     foreach ($entities as $entity_id) {
       $serialized_by_type = $manager->exportContentWithReferences($entity_type_id, $entity_id);
+      if ($skip_core_users) {
+        _drush_default_content_remove_core_users($serialized_by_type);
+      }
       $manager->writeDefaultContent($serialized_by_type, $folder);
     }
   }
   else {
     $serialized_by_type = $manager->exportContentWithReferences($entity_type_id, $entity_id);
+    if ($skip_core_users) {
+      _drush_default_content_remove_core_users($serialized_by_type);
+    }
     $manager->writeDefaultContent($serialized_by_type, $folder);
   }
 }
 
 /**
+ * Removes default core users from the list of all entities.
+ *
+ * @param array $entities
+ *   Keyed array of entities by entity type.
+ */
+function _drush_default_content_remove_core_users(&$entities) {
+  if (empty($entities['user'])) {
+    return;
+  }
+  foreach ($entities['user'] as $uuid => $user) {
+    // Deserialize as array to iterate values.
+    $data = json_decode($user, TRUE);
+    foreach ($data['uid'] as $item) {
+      foreach ($item as $key => $value) {
+        if ($key === 'value' && ($value === '0' || $value === '1')) {
+          unset($entities['user'][$uuid]);
+        }
+      }
+    }
+  }
+  if (empty($entities['user'])) {
+    // Skip to create empty directory.
+    unset($entities['user']);
+  }
+}
+
+/**
  * Exports all of the content for a given module.
  *
  * @param string $module_name
