How to add a redirection at the end of Delete entity process? I used Drupal Console to create a custom content entity called 'Service' (with command drupal geco) which generated all expected code including 'ServiceDeleteForm.php':

&lt;?php
namespace Drupal\sel\Form;
use Drupal\Core\Entity\ContentEntityDeleteForm;
/**
 * Provides a form for deleting Service category entities.
 *
 * @ingroup sel
 */
class ServiceDeleteForm extends ContentEntityDeleteForm {
}


I added some code of mine there:

class ServiceDeleteForm extends ContentEntityDeleteForm {

  protected function getDeletionMessage() {
    $entity = $this-&gt;getEntity();
    drupal_set_message($this-&gt;t('Le service « %label » a été supprimé.', [
      '%label' =&gt; $entity-&gt;label(),
    ]));
  }

  public function getQuestion() {
    return $this-&gt;t('Êtes-vous certain de vouloir supprimer le service « %label » ?', [
      '%label' =&gt; $this-&gt;getEntity()-&gt;label(),
    ]);
  }

}


which works fine.
I'd like to add a redirection at the end of the Delete process, something like  $form_state-&gt;setRedirect('elsewhere', [some argument]);
but I don't know how to do it.
Could someone help? Thanks in advance.
Finally, this code works:

&lt;?php
namespace Drupal\sel\Form;
use Drupal\Core\Entity\ContentEntityDeleteForm;
use Drupal\Core\Form\FormStateInterface;

/**
 * Provides a form for deleting Service entities.
 *
 * @ingroup sel
 */

class ServiceDeleteForm extends ContentEntityDeleteForm {

  public function submitForm(array &amp;$form, FormStateInterface $form_state) {
    $entity = $this-&gt;getEntity();

    $entity-&gt;delete();
    $form_state-&gt;setRedirect('elsewhere', [some argument]);
    drupal_set_message($this-&gt;getDeletionMessage());

  }

  protected function getDeletionMessage() { some code }

  public function getQuestion() { some code }

}