Add a link field to block form
You want to change '#type' =&gt; 'link' to '#type' =&gt; 'url'

public function blockForm($form, FormStateInterface $form_state) {
  //...
  $form['link'] = [
    '#type' =&gt; 'url',
    '#title' =&gt; $this-&gt;t('Link title'),
    '#options' =&gt; ['external' =&gt; TRUE]
  ];

  return $form;
}