diff --git a/flag_lists.module b/flag_lists.module
index 7dbc1e1..c63f83e 100644
--- a/flag_lists.module
+++ b/flag_lists.module
@@ -14,6 +14,8 @@ use Drupal\Core\Link;
 use Drupal\Core\Url;
 use Drupal\flag\FlagInterface;
 use Drupal\flag_lists\FlagTracker;
+use Drupal\flag_lists\Entity\FlaggingCollection;
+use Drupal\flag\Entity\Flag;
 
 /**
  * Implements hook_help().
@@ -175,6 +177,11 @@ function flag_lists_form_alter(&$form, FormStateInterface $form_state, $form_id)
       $isFlagForList = !empty($flag_template);
     }
 
+    $hasActions = TRUE;
+    if ($isFlagForList) {
+      $hasActions = $flag_template->getHasActions();
+    }
+
     $form['fl_fieldset']['flag_lists_flag'] = [
       '#type' => 'checkbox',
       '#title' => t('Flagging Collection Template'),
@@ -183,6 +190,16 @@ function flag_lists_form_alter(&$form, FormStateInterface $form_state, $form_id)
       '#disabled' => $isFlagForList,
       '#weight' => '0',
     ];
+
+    $form['fl_fieldset']['flag_lists_hasactions'] = [
+      '#type' => 'checkbox',
+      '#title' => t('Flagging Collection generate actions'),
+      '#description' => t('Will this flag template will generate action links? This setting can be changed but the already created flagging_collection with this template wont be.'),
+      '#default_value' => $hasActions,
+      // '#disabled' => $isFlagForList,
+      '#weight' => '1',
+    ];
+
     $form['actions']['submit']['#submit'][] = 'flag_lists_save_submit';
 
   }
@@ -337,3 +354,97 @@ function flag_lists_entity_extra_field_info_alter(&$info) {
     }
   }
 }
+
+/**
+ * Implements hook_ENTITY_TYPE_insert() for 'flagging_collection'.
+ */
+function flag_lists_flagging_collection_insert(FlaggingCollection $entity) {
+  // Create the related flag
+  // Copy all field data from the base_flag, Template Flag
+  // and store it in the a new Flag, referenced as related_flag.
+  $flagListService = \Drupal::service('flaglists');
+  $flagService = \Drupal::service('flag');
+  $FlagForList = $flagListService
+    ->getFlagForListById($entity->getBaseFlag()->id());
+  $flag_to_use = $flagService->getFlagById($FlagForList->get('base_flag'));
+
+  // Copy its important content to a array.
+  $template['label'] = $entity->label();
+  // The id = machine id must be conformant with the rules.
+  $template['id'] = 'flagcol_' . $entity->id();
+  $template['global'] = $flag_to_use->isGlobal();
+  $template['bundles'] = $flag_to_use->getBundles();
+  $template['flag_short'] =
+    $flag_to_use->getShortText('flag');
+  $template['flag_long'] =
+    $flag_to_use->getLongText('flag');
+  $template['flag_message'] =
+    $flag_to_use->getMessage('flag');
+  $template['unflag_short'] =
+    $flag_to_use->getShortText('unflag');
+  $template['unflag_long'] =
+    $flag_to_use->getLongText('unflag');
+  $template['unflag_message'] =
+    $flag_to_use->getMessage('unflag');
+  $template['access'] = [];
+  $template['access']['bundles'] = '';
+  $template['unflag_denied_text'] = '';
+  $template['link_type'] =
+    $flag_to_use->getLinkTypePlugin()->getPluginId();
+  $template['flag_type'] =
+    $flag_to_use->getFlagTypePlugin()->getPluginId();
+  $template['entity_type'] =
+    $flag_to_use->getFlaggableEntityTypeId();
+  $template['flagTypeConfig'] =
+    $flag_to_use->getFlagTypePlugin()->getConfiguration();
+
+  // Use the array to create a new, possibly uniq, flag.
+  $flag = new flag($template, 'flag');
+  $flag->save();
+
+  $entity->setRelatedFlag($flag->id());
+  $entity->save();
+
+  // create actions
+  // The action plugin cache needs to detect the new flag.
+  /** @var \Drupal\Core\Action\ActionManager $action_manager */
+  $action_manager = \Drupal::service('plugin.manager.action');
+  $action_manager->clearCachedDefinitions();
+
+  if ($FlagForList->getHasActions()) {
+    // Add the flag/unflag actions for this flag and entity combination.
+    $flag_id = 'flag_action.' . $flag->id() . '_flag';
+    if (!Action::load($flag_id)) {
+      $action = Action::create([
+        'id' => $flag_id,
+        'type' => $flag->getFlaggableEntityTypeId(),
+        'label' => \Drupal::token()->replace($flag->getShortText('flag'),
+          ['flagging_collection' => $entity],
+          ['clear']),
+        'plugin' => 'flag_action:' . $flag->id() . '_flag',
+        'configuration' => [
+          'flag_id' => $flag->id(),
+          'flag_action' => 'flag',
+        ],
+      ]);
+      $action->trustData()->save();
+    }
+    $unflag_id = 'flag_action.' . $flag->id() . '_unflag';
+    if (!Action::load($unflag_id)) {
+      $action = Action::create([
+        'id' => $unflag_id,
+        'type' => $flag->getFlaggableEntityTypeId(),
+        'label' => \Drupal::token()->replace($flag->getShortText('unflag'),
+          ['flagging_collection' => $entity],
+          ['clear']),
+        'plugin' => 'flag_action:' . $flag->id() . '_unflag',
+        'configuration' => [
+          'flag_id' => $flag->id(),
+          'flag_action' => 'unflag',
+        ],
+      ]);
+      $action->trustData()->save();
+    }
+  }
+
+}
diff --git a/src/Entity/FlagForList.php b/src/Entity/FlagForList.php
index f12a5a5..3b15612 100644
--- a/src/Entity/FlagForList.php
+++ b/src/Entity/FlagForList.php
@@ -44,7 +44,8 @@ use Drupal\Core\Entity\EntityStorageInterface;
  *     "dependencies",
  *     "base_flag",
  *     "owner",
- *     "weight"
+ *     "weight",
+ *     "has_actions"
  *   },
  *   links = {
  *     "canonical" = "/admin/structure/flag_lists/{flag_for_list}",
@@ -84,6 +85,13 @@ class FlagForList extends ConfigEntityBase implements FlagForListInterface {
    */
   protected $owner = NULL;
 
+  /**
+   * If this list has actions or not.
+   *
+   * @var boolean
+   */
+  protected $has_actions = TRUE;
+
   /**
    * {@inheritdoc}
    */
@@ -118,6 +126,20 @@ class FlagForList extends ConfigEntityBase implements FlagForListInterface {
     }
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function getHasActions() {
+    return $this->has_actions;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function setHasActions($hasactions) {
+    $this->has_actions = $hasactions;
+  }
+
   /**
    * {@inheritdoc}
    */
diff --git a/src/Entity/FlaggingCollection.php b/src/Entity/FlaggingCollection.php
index e6a069c..6ff0ce1 100644
--- a/src/Entity/FlaggingCollection.php
+++ b/src/Entity/FlaggingCollection.php
@@ -96,56 +96,6 @@ class FlaggingCollection extends RevisionableContentEntityBase implements Flaggi
     ];
   }
 
-  /**
-   * {@inheritdoc}
-   */
-  public function save() {
-    parent::save();
-    $flag = $this->getRelatedFlag();
-    if ($flag->isSyncing()) {
-      // Do not create actions when config is progress of synchronization.
-      return;
-    }
-    // The action plugin cache needs to detect the new flag.
-    /** @var \Drupal\Core\Action\ActionManager $action_manager */
-    $action_manager = \Drupal::service('plugin.manager.action');
-    $action_manager->clearCachedDefinitions();
-
-    // Add the flag/unflag actions for this flag and entity combination.
-    $flag_id = 'flag_action.' . $flag->id() . '_flag';
-    if (!Action::load($flag_id)) {
-      $action = Action::create([
-        'id' => $flag_id,
-        'type' => $flag->getFlaggableEntityTypeId(),
-        'label' => \Drupal::token()->replace($flag->getShortText('flag'),
-          ['flagging_collection' => $this],
-          ['clear']),
-        'plugin' => 'flag_action:' . $flag->id() . '_flag',
-        'configuration' => [
-          'flag_id' => $flag->id(),
-          'flag_action' => 'flag',
-        ],
-      ]);
-      $action->trustData()->save();
-    }
-    $unflag_id = 'flag_action.' . $flag->id() . '_unflag';
-    if (!Action::load($unflag_id)) {
-      $action = Action::create([
-        'id' => $unflag_id,
-        'type' => $flag->getFlaggableEntityTypeId(),
-        'label' => \Drupal::token()->replace($flag->getShortText('unflag'),
-          ['flagging_collection' => $this],
-          ['clear']),
-        'plugin' => 'flag_action:' . $flag->id() . '_unflag',
-        'configuration' => [
-          'flag_id' => $flag->id(),
-          'flag_action' => 'unflag',
-        ],
-      ]);
-      $action->trustData()->save();
-    }
-  }
-
   /**
    * {@inheritdoc}
    */
@@ -168,55 +118,6 @@ class FlaggingCollection extends RevisionableContentEntityBase implements Flaggi
       $this->setRevisionUserId($this->getOwnerId());
     }
 
-    // Copy all field data from the base_flag, Template Flag
-    // and store it in the a new Flag, referenced as related_flag.
-    $flagListService = \Drupal::service('flaglists');
-    $flagService = \Drupal::service('flag');
-    $baseFlag = $flagListService
-      ->getFlagForListById($this->getBaseFlag()->id());
-    $flag_to_use = $flagService->getFlagById($baseFlag->get('base_flag'));
-
-    // Copy its important content to a array.
-    $template['label'] = $this->label();
-    if ($this->isNew()) {
-      // The id = machine id must be conformant with the rules.
-      $template['id'] = strtolower($this->label());
-      $template['id'] = preg_replace("/[^a-z0-9_]/", "_", $template['id']);
-      $this->setRelatedFlag($template['id']);
-    }
-    else {
-      // The Flagging Collection exist so reuse the old id.
-      $template['id'] = $this->getRelatedFlag()->id();
-    }
-    $template['global'] = $flag_to_use->isGlobal();
-    $template['bundles'] = $flag_to_use->getBundles();
-    $template['flag_short'] =
-      $flag_to_use->getShortText('flag');
-    $template['flag_long'] =
-      $flag_to_use->getLongText('flag');
-    $template['flag_message'] =
-      $flag_to_use->getMessage('flag');
-    $template['unflag_short'] =
-      $flag_to_use->getShortText('unflag');
-    $template['unflag_long'] =
-      $flag_to_use->getLongText('unflag');
-    $template['unflag_message'] =
-      $flag_to_use->getMessage('unflag');
-    $template['access'] = [];
-    $template['access']['bundles'] = '';
-    $template['unflag_denied_text'] = '';
-    $template['link_type'] =
-      $flag_to_use->getLinkTypePlugin()->getPluginId();
-    $template['flag_type'] =
-      $flag_to_use->getFlagTypePlugin()->getPluginId();
-    $template['entity_type'] =
-      $flag_to_use->getFlaggableEntityTypeId();
-    $template['flagTypeConfig'] =
-      $flag_to_use->getFlagTypePlugin()->getConfiguration();
-
-    // Use the array to create a new, possibly uniq, flag.
-    $flag = new flag($template, 'flag');
-    $flag->save();
   }
 
   /**
@@ -225,18 +126,21 @@ class FlaggingCollection extends RevisionableContentEntityBase implements Flaggi
   public function delete() {
     $flag = $this->getRelatedFlag();
     // Do not delete actions when config is progress of synchronization.
-    if ($flag->isSyncing()) {
-      return;
-    }
+    if ($flag) {
+      if ($flag->isSyncing()) {
+        return;
+      }
 
-    $actions = Action::loadMultiple([
-      'flag_action.' . $flag->id() . '_flag',
-      'flag_action.' . $flag->id() . '_unflag',
-    ]);
+      $actions = Action::loadMultiple([
+        'flag_action.' . $flag->id() . '_flag',
+        'flag_action.' . $flag->id() . '_unflag',
+      ]);
+
+      // Remove the flag/unflag actions for this flag and entity combination.
+      foreach ($actions as $action) {
+        $action->delete();
+      }
 
-    // Remove the flag/unflag actions for this flag and entity combination.
-    foreach ($actions as $action) {
-      $action->delete();
     }
     parent::delete();
   }
@@ -250,8 +154,11 @@ class FlaggingCollection extends RevisionableContentEntityBase implements Flaggi
     // related Flag.
     $flagService = \Drupal::service('flag');
     foreach ($entities as $entity) {
-      $flag = $flagService->getFlagById($entity->getRelatedFlag()->id());
-      $flag->delete();
+      $relatedflag = $entity->getRelatedFlag();
+      if ($relatedflag) {
+        $flag = $flagService->getFlagById($relatedflag->id());
+        $flag->delete();
+      }
     }
     parent::preDelete($storage, $entities);
   }
diff --git a/src/FlagTracker.php b/src/FlagTracker.php
index 6f1d5bf..4f26477 100644
--- a/src/FlagTracker.php
+++ b/src/FlagTracker.php
@@ -24,16 +24,19 @@ class FlagTracker {
    */
   public static function save(array $form, FormStateInterface $form_state) {
 
+    // $hasactions = $form_state->getValue('flag_lists_hasactions');
     $flagValues = $form_state->getValues();
 
     $build_array = [];
     $build_array['id'] = $flagValues['id'];
     $build_array['label'] = $flagValues['label'];
+    $build_array['hasactions'] = $flagValues['flag_lists_hasactions'];
 
     $flagForList = new FlagForList($build_array, 'flag_for_list');
 
     $flagForList->setBaseFlag($flagValues['id']);
     $flagForList->setOwner();
+    $flagForList->setHasActions($form_state->getValue('flag_lists_hasactions'));
     $flagForList->save();
   }
 
@@ -54,6 +57,7 @@ class FlagTracker {
     FlagForList $flagTemplate) {
     $flagTemplate->set('label', $form_state->getValue('label'));
     $flagTemplate->setOwner();
+    $flagTemplate->setHasActions($form_state->getValue('flag_lists_hasactions'));
     $flagTemplate->save();
   }
 
