diff --git a/core/modules/shortcut/shortcut.install b/core/modules/shortcut/shortcut.install
index b7ed49c..1039a0c 100644
--- a/core/modules/shortcut/shortcut.install
+++ b/core/modules/shortcut/shortcut.install
@@ -7,6 +7,7 @@
 
 use Drupal\Core\Database\Database;
 use Drupal\Core\Language\Language;
+use Symfony\Component\Routing\Exception\RouteNotFoundException;
 
 /**
  * Implements hook_schema().
@@ -139,3 +140,20 @@ function shortcut_schema() {
 
   return $schema;
 }
+
+/**
+ * Implements hook_modules_uninstall().
+ */
+function shortcut_modules_uninstalled(array $modules) {
+  /** @var \Drupal\Core\Routing\RouteProviderInterface $route_provider */
+  $route_provider = \Drupal::service('router.route_provider');
+  foreach (entity_load_multiple('shortcut') as $shortcut) {
+    /** @var \Drupal\shortcut\ShortcutInterface $shortcut */
+    try {
+      debug($route_provider->getRouteByName($shortcut->getRouteName()));
+    }
+    catch (RouteNotFoundException $e) {
+      $shortcut->delete();
+    }
+  }
+}
diff --git a/core/modules/shortcut/src/Tests/ShortcutLinksTest.php b/core/modules/shortcut/src/Tests/ShortcutLinksTest.php
index cf2d732..5f1e182 100644
--- a/core/modules/shortcut/src/Tests/ShortcutLinksTest.php
+++ b/core/modules/shortcut/src/Tests/ShortcutLinksTest.php
@@ -215,4 +215,16 @@ public function testNoShortcutLink() {
     $this->assertTrue(!empty($result), 'Add to shortcuts link was shown on a page the user does have access to.');
   }
 
+  /**
+   * Confirms that shortcuts are deleted when their routes are.
+   */
+  public function testDeleteShortcutsUponRouteDeletion() {
+    /** @var \Drupal\shortcut\ShortcutInterface $shortcut */
+    $shortcut = entity_create('shortcut');
+    $shortcut->setRouteName('node.add_page');
+    $shortcut->save();
+    \Drupal::moduleHandler()->uninstall(array('node'));
+    $this->assertFalse((bool) entity_load('shortcut', $shortcut->id()));
+  }
+
 }
