diff --git a/config/install/media_entity_file_replace.settings.yml b/config/install/media_entity_file_replace.settings.yml
new file mode 100644
index 0000000..f9227ec
--- /dev/null
+++ b/config/install/media_entity_file_replace.settings.yml
@@ -0,0 +1 @@
+prompt_delete_original_file : 0
diff --git a/config/schema/media_entity_file_replace.schema.yml b/config/schema/media_entity_file_replace.schema.yml
new file mode 100644
index 0000000..84e7da7
--- /dev/null
+++ b/config/schema/media_entity_file_replace.schema.yml
@@ -0,0 +1,9 @@
+# Schema for the configuration files of the Media entity file replace module.
+
+media_entity_file_replace.settings:
+  type: config_object
+  label: 'Media entity file replace settings'
+  mapping:
+    prompt_delete_original_file:
+      type: integer
+      label: 'Prompt delete original file'
\ No newline at end of file
diff --git a/media_entity_file_replace.links.menu.yml b/media_entity_file_replace.links.menu.yml
new file mode 100644
index 0000000..ca4df51
--- /dev/null
+++ b/media_entity_file_replace.links.menu.yml
@@ -0,0 +1,5 @@
+media_entity_file_replace.settings:
+  title:  'Media Entity File Replace settings'
+  description: 'Define parameters for media entity file replace module.'
+  route_name: media_entity_file_replace.settings
+  parent: system.admin_config_media
diff --git a/media_entity_file_replace.module b/media_entity_file_replace.module
index a9c8cdd..6885875 100644
--- a/media_entity_file_replace.module
+++ b/media_entity_file_replace.module
@@ -114,9 +114,15 @@ function media_entity_file_replace_form_media_form_alter(&$form, FormStateInterf
     ];
     $form['replace_file']['replacement_file']['#description'] = \Drupal::service('renderer')->renderPlain($helpText);
 
+    $config = \Drupal::config('media_entity_file_replace.settings');
+    $prompt_delete=$config->get('prompt_delete_original_file');
+    $description = t('When checked, the original filename is kept and its contents are replaced with the new file. If unchecked, the filename of the replacement file will be used, and the original file may be deleted if no previous revision references it (depending on your specific site configuration).');
+    if($prompt_delete) {
+      $description = t('When checked, the original filename is kept and its contents are replaced with the new file. If unchecked, the filename of the replacement file will be used, and the original file will be deleted.');
+    }
     $form['replace_file']['keep_original_filename'] = [
       '#title' => t('Overwrite original file'),
-      '#description' => t('When checked, the original filename is kept and its contents are replaced with the new file. If unchecked, the filename of the replacement file will be used, and the original file may be deleted if no previous revision references it (depending on your specific site configuration).'),
+      '#description' => $description,
       '#type' => 'checkbox',
       '#default_value' => TRUE,
     ];
@@ -237,11 +243,10 @@ function _media_entity_file_replace_submit($form, FormStateInterface $formState)
 
   /** @var \Drupal\media\Entity\Media $media */
   $media = $formState->getFormObject()->getEntity();
+  $fid = $media->getSource()->getSourceFieldValue($media);
+  $originalFile = \Drupal::entityTypeManager()->getStorage('file')->load($fid);
 
   if ($formState->getValue('keep_original_filename')) {
-    $fid = $media->getSource()->getSourceFieldValue($media);
-    $originalFile = \Drupal::entityTypeManager()->getStorage('file')->load($fid);
-
     // Copy the uploaded file (which is in temporary storage) to the existing
     // file location, overwriting it.
     $fileSystem = \Drupal::service('file_system');
@@ -290,5 +295,12 @@ function _media_entity_file_replace_submit($form, FormStateInterface $formState)
     // callback is the MediaForm::save() one which will save it.
     $sourceFieldName = $form['replace_file']['replacement_file']['#source_field_name'];
     $media->set($sourceFieldName, $replacementFile);
+
+    $config = \Drupal::config('media_entity_file_replace.settings');
+    $prompt_delete=$config->get('prompt_delete_original_file');
+    if($prompt_delete) {
+      // Delete physically the original file.:q
+      $originalFile->delete();
+    }
   }
 }
diff --git a/media_entity_file_replace.routing.yml b/media_entity_file_replace.routing.yml
new file mode 100644
index 0000000..941dda4
--- /dev/null
+++ b/media_entity_file_replace.routing.yml
@@ -0,0 +1,7 @@
+media_entity_file_replace.settings:
+  path: '/admin/config/media/media_entity_file_replace'
+  defaults:
+    _form: '\Drupal\media_entity_file_replace\Form\MediaEntityFileReplaceSettingsForm'
+    _title: 'media_entity_file_replace'
+  requirements:
+    _permission: 'administer site configuration'
\ No newline at end of file
diff --git a/src/Form/MediaEntityFileReplaceSettingsForm.php b/src/Form/MediaEntityFileReplaceSettingsForm.php
new file mode 100644
index 0000000..503dbb2
--- /dev/null
+++ b/src/Form/MediaEntityFileReplaceSettingsForm.php
@@ -0,0 +1,57 @@
+<?php
+
+namespace Drupal\media_entity_file_replace\Form;
+
+use Drupal\Core\Form\ConfigFormBase;
+use Drupal\Core\Form\FormStateInterface;
+
+/**
+ * Configure media_entity_file_replace settings for this site.
+ */
+class MediaEntityFileReplaceSettingsForm extends ConfigFormBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getFormId() {
+    return 'media_entity_file_replace.settings';
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function getEditableConfigNames() {
+    return [
+      'media_entity_file_replace.settings',
+    ];
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function buildForm(array $form, FormStateInterface $form_state) {
+    $config = $this->config('media_entity_file_replace.settings');
+
+    $form['prompt_delete_original_file'] = [
+      '#type' => 'checkbox',
+      '#title' => $this->t('prompt delete original file'),
+      '#default_value' => $config->get('prompt_delete_original_file'),
+      '#description' => t('When checked, the original filename is deleted immediately after replacement (when replacing without override ). If unchecked, original file may be deleted if no previous revision references it (depending on your specific site configuration).')
+    ];
+
+    return parent::buildForm($form, $form_state);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function submitForm(array &$form, FormStateInterface $form_state) {
+    // Retrieve the configuration
+    $this->config('media_entity_file_replace.settings')
+      // Set the submitted configuration setting
+      ->set('prompt_delete_original_file', $form_state->getValue('prompt_delete_original_file'))
+      ->save();
+
+    parent::submitForm($form, $form_state);
+  }
+}
