diff --git a/core/modules/media/src/MediaTypeForm.php b/core/modules/media/src/MediaTypeForm.php
index 7766af2e56..716201f99c 100644
--- a/core/modules/media/src/MediaTypeForm.php
+++ b/core/modules/media/src/MediaTypeForm.php
@@ -76,6 +76,9 @@ public function form(array $form, FormStateInterface $form_state) {
     /** @var \Drupal\media\MediaSourceInterface $source */
     $source = $this->entity->get('source') ? $this->entity->getSource() : NULL;
 
+    // Check if the source field can be changed.
+    $source_changeable = $this->isSourceChangeable();
+
     if ($this->operation === 'add') {
       $form['#title'] = $this->t('Add media type');
     }
@@ -118,7 +121,7 @@ public function form(array $form, FormStateInterface $form_state) {
       '#attributes' => ['id' => 'source-dependent'],
     ];
 
-    if ($source) {
+    if (!$source_changeable) {
       $source_description = $this->t('<em>The media source cannot be changed after the media type is created.</em>');
     }
     else {
@@ -141,7 +144,7 @@ public function form(array $form, FormStateInterface $form_state) {
       '#required' => TRUE,
       // Once the media type is created, its source plugin cannot be changed
       // anymore.
-      '#disabled' => !empty($source),
+      '#disabled' => !$source_changeable,
     ];
 
     if (!$source) {
@@ -392,4 +395,89 @@ public function save(array $form, FormStateInterface $form_state) {
     $form_state->setRedirectUrl($media_type->toUrl('collection'));
   }
 
+  /**
+   * Check if the source is changeable.
+   *
+   * @return bool
+   *   True if source can be changed, false if not.
+   *
+   * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
+   */
+  private function isSourceChangeable() {
+    // Allow source changes for new media types.
+    if ($this->entity->isNew()) {
+      return TRUE;
+    }
+
+    // Check if field mapping exists.
+    if (!$this->fieldMapEmpty()) {
+      return FALSE;
+    }
+
+    // Check if only the source field is set
+    if (!$this->hasOnlySourceField()) {
+      return FALSE;
+    }
+
+    // Check if entities of this type exist.
+    if ($this->entityCount() > 0) {
+      return FALSE;
+    }
+
+    return TRUE;
+  }
+
+  /**
+   * Get the number of entities of this media type.
+   *
+   * @return int
+   *   The number of entities.
+   *
+   * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
+   */
+  private function entityCount() {
+    return $this->entityTypeManager->getStorage('media')->getQuery()
+      ->condition('bundle', $this->entity->id())
+      ->count()
+      ->execute();
+  }
+
+  /**
+   * Check if the source field is the only field.
+   *
+   * @return bool
+   *   If the source field is the only field.
+   */
+  private function hasOnlySourceField() {
+    // Make sure this is an existing media entity.
+    if (!$this->entity->isNew()) {
+      $source = $this->entity->getSource();
+      $source_field = $source->getSourceFieldDefinition($this->entity);
+
+      $field_definitions = $this->entityFieldManager->getFieldDefinitions('media', $this->entity->id());
+      $base_fields = $this->entityFieldManager->getBaseFieldDefinitions('media');
+
+      $fields = array_diff_key($field_definitions, $base_fields);
+
+      if (is_array($fields) && count($fields) == 1 && isset($fields[$source_field->getName()])) {
+        return TRUE;
+      }
+    }
+    return FALSE;
+  }
+
+  /**
+   * Check if the values in the field map are empty.
+   *
+   * @return bool
+   *   Field map values empty or not.
+   */
+  private function fieldMapEmpty() {
+    $fields = $this->entity->getFieldMap();
+    if (!$fields || (count(array_unique($fields)) === 1 && end($fields) === MediaSourceInterface::METADATA_FIELD_EMPTY)) {
+      return TRUE;
+    }
+    return FALSE;
+  }
+
 }
