diff --git a/token.tokens.inc b/token.tokens.inc
index 717fad8..03a32c5 100644
--- a/token.tokens.inc
+++ b/token.tokens.inc
@@ -20,6 +20,7 @@ use Drupal\menu_link_content\MenuLinkContentInterface;
 use Drupal\system\Entity\Menu;
 use Drupal\user\UserInterface;
 use Symfony\Cmf\Component\Routing\RouteObjectInterface;
+use Drupal\Core\Entity\ContentEntityTypeInterface;
 
 /**
  * Implements hook_token_info_alter().
@@ -63,8 +64,9 @@ function token_token_info_alter(&$info) {
   // Add [token:url] tokens for any URI-able entities.
   $entities = \Drupal::entityTypeManager()->getDefinitions();
   foreach ($entities as $entity => $entity_info) {
-    /* @var \Drupal\Core\Entity\EntityType $entity_info */
-    if (!$entity_info->get('token_type')) {
+    // Do not generate tokens if the entity doesn't define a token type or is
+    // not a content entity.
+    if (!$entity_info->get('token_type') || (!$entity_info instanceof ContentEntityTypeInterface)) {
       continue;
     }
 
