diff --git a/core/modules/views/src/Plugin/views/display/Feed.php b/core/modules/views/src/Plugin/views/display/Feed.php
index 67171ab..c558b89 100644
--- a/core/modules/views/src/Plugin/views/display/Feed.php
+++ b/core/modules/views/src/Plugin/views/display/Feed.php
@@ -258,6 +258,11 @@ public function submitOptionsForm(&$form, FormStateInterface $form_state) {
    * {@inheritdoc}
    */
   public function attachTo(ViewExecutable $clone, $display_id, array &$build) {
+    // Disabled feed attachments do not attach.
+    if (!$this->isEnabled()) {
+      return;
+    }
+
     $displays = $this->getOption('displays');
     if (empty($displays[$display_id])) {
       return;
diff --git a/core/modules/views/src/Tests/Plugin/DisplayFeedTest.php b/core/modules/views/src/Tests/Plugin/DisplayFeedTest.php
index cef9bab..4cdda1b 100644
--- a/core/modules/views/src/Tests/Plugin/DisplayFeedTest.php
+++ b/core/modules/views/src/Tests/Plugin/DisplayFeedTest.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\views\Tests\Plugin;
 
+use Drupal\views\Views;
+
 /**
  * Tests the feed display plugin.
  *
@@ -74,4 +76,36 @@ public function testFeedOutput() {
     $this->assertTrue(strpos($feed_icon[0]['href'], 'test-feed-display.xml'), 'The feed icon was found.');
   }
 
+  /**
+   * Tests that nothing is output when the feed display is disabled.
+   */
+  public function testDisabledFeed() {
+    $this->drupalCreateContentType(['type' => 'page']);
+    $node = $this->drupalCreateNode();
+
+    // Ensure that the feed_1 display is attached to the page display.
+    $view = Views::getView('test_display_feed');
+    $view->setDisplay('page');
+    $this->assertEqual($view->display_handler->getAttachedDisplays(), array('feed_1'));
+
+    // Check that the rss header is output on the page display.
+    $this->drupalGet('/test-feed-display');
+    $feed_header = $this->xpath('//link[@rel="alternate"]');
+    $this->assertEqual($feed_header[0]['type'], 'application/rss+xml');
+    $this->assertTrue(strpos($feed_header[0]['href'], 'test-feed-display.xml'), 'Page display contains the correct feed URL.');
+
+    // Disable the feed display.
+    $view->setDisplay('feed_1');
+    $view->display_handler->setOption('enabled', FALSE);
+    $view->save();
+
+    // Ensure there is no link rel present.
+    $this->drupalGet('/test-feed-display');
+    $result = $this->xpath('//link[@rel="alternate"]');
+    $this->assertTrue(empty($result), 'Page display does not contain a feed header.');
+
+    // Ensure the feed attachment returns 'Not found'.
+    $this->drupalGet('/test-feed-display.xml');
+    $this->assertResponse(404);
+  }
 }
