protected function getContentEntityTypes() {
    $ids = [
      'block_content',
      'media',
      'node',
      'paragraph',
      'taxonomy_term',
    ];
    $entity_types = [];
    foreach ($ids as $id) {
      try {
        $entity_types[] = $this->entityTypeManager()->getDefinition($id);
      }
      catch (PluginNotFoundException $e) {
        // A PluginNotFoundException here just means that the module providing
        // the entity type in question isn't installed. Continue.
      }
    }
    return $entity_types;
  }