diff --git a/src/Form/PathautoSettingsForm.php b/src/Form/PathautoSettingsForm.php
index d6341fe..3f6b05f 100644
--- a/src/Form/PathautoSettingsForm.php
+++ b/src/Form/PathautoSettingsForm.php
@@ -94,7 +94,7 @@ class PathautoSettingsForm extends ConfigFormBase {
 
     $description = t('What should Pathauto do when updating an existing content item which already has an alias?');
     if (\Drupal::moduleHandler()->moduleExists('redirect')) {
-      $description .= ' ' . t('The <a href=":url">Redirect module settings</a> affect whether a redirect is created when an alias is deleted.', array(':url' => \Drupal::url('redirect.settings')));
+      $description .= ' ' . t('The <a href=":url">Redirect module settings</a> affect whether a redirect is created when an alias is deleted.', array(':url' => Url::fromRoute('redirect.settings')->toString()));
     }
     else {
       $description .= ' ' . t('Considering installing the <a href=":url">Redirect module</a> to get redirects when your aliases change.', array(':url' => 'http://drupal.org/project/redirect'));
diff --git a/src/PathautoWidget.php b/src/PathautoWidget.php
index 751da98..9d45a12 100644
--- a/src/PathautoWidget.php
+++ b/src/PathautoWidget.php
@@ -9,6 +9,7 @@ namespace Drupal\pathauto;
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\path\Plugin\Field\FieldWidget\PathWidget;
 use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Url;
 
 /**
  * Extends the core path widget.
@@ -50,7 +51,7 @@ class PathautoWidget extends PathWidget {
       '#type' => 'checkbox',
       '#title' => $this->t('Generate automatic URL alias'),
       '#default_value' => $entity->path->pathauto,
-      '#description' => $this->t('Uncheck this to create a custom alias below. <a href="@admin_link">Configure URL alias patterns.</a>', array('@admin_link' => \Drupal::url('entity.pathauto_pattern.collection'))),
+      '#description' => $this->t('Uncheck this to create a custom alias below. <a href="@admin_link">Configure URL alias patterns.</a>', array('@admin_link' => Url::fromRoute('entity.pathauto_pattern.collection')->toString())),
       '#weight' => -1,
     );
 
