Here are 2 ways to get a list of content types.
// 1st way $content_types = \Drupal::entityTypeManager()->getStorage('node_type')->loadMultiple(); // If you need them to disply in a drop down. $content_type_options=[]; foreach ($content_types as $node_type) { $content_type_options[$node_type->id()] = $node_type->label(); } // 2nd way $content_types = \Drupal\node\Entity\NodeType::loadMultiple(); // If you need them to disply in a drop down. foreach ($content_types as $node_type) { $content_type_options[$node_type->id()] = $node_type->label(); }