diff --git a/metatag.module b/metatag.module
index 58776d60..2eec0203 100644
--- a/metatag.module
+++ b/metatag.module
@@ -1220,6 +1220,23 @@ function metatag_tokens($type, $tokens, array $data, array $options, BubbleableM
       }
       $tags += metatag_get_default_tags($entity);
 
+      //filter to process only relevant tags
+      $tags = array_filter($tags, function ($tagValue, $key) use ($tokens) {
+        // Only keep tags that have a corresponding token.
+        $return = false;
+        foreach ($tokens as $tokenName => $fulltoken) {
+          $tokenNameParts = explode(':', $tokenName);
+          $return |= in_array($key, $tokenNameParts) || $key === $tokenName;
+          if($return) {
+            if(strpos($tagValue, $fulltoken) !== FALSE) {
+              // If the tag value contains the token for it, we ignore it.
+              $return = false;
+            }
+          }
+        }
+        return $return;
+      }, ARRAY_FILTER_USE_BOTH);
+
       // Trigger hook_metatags_alter().
       // Allow modules to override tags or the entity used for token
       // replacements.
diff --git a/src/MetatagManager.php b/src/MetatagManager.php
index 0d40eded..19cc93dd 100644
--- a/src/MetatagManager.php
+++ b/src/MetatagManager.php
@@ -688,6 +688,7 @@ class MetatagManager implements MetatagManagerInterface {
     if (!isset($this->processedTokenCache[$entity_identifier])) {
       $metatag_tags = $this->sortedTags();
 
+      $this->processedTokenCache[$entity_identifier] = [];
       // Each element of the $values array is a tag with the tag plugin name as
       // the key.
       foreach ($tags as $tag_name => $value) {
