diff --git a/core/modules/system/src/Element/StatusReportPage.php b/core/modules/system/src/Element/StatusReportPage.php
index 5d2f985..f8ae4b2 100644
--- a/core/modules/system/src/Element/StatusReportPage.php
+++ b/core/modules/system/src/Element/StatusReportPage.php
@@ -50,7 +50,9 @@ public static function preRenderGeneralInfo($element) {
             }
           }
           $element['#general_info']['#' . $key] = $requirement;
-          unset($element['#requirements'][$key]);
+          if (empty($requirement['severity']) || $requirement['severity'] == REQUIREMENT_OK) {
+            unset($element['#requirements'][$key]);
+          }
           break;
 
         case 'drupal':
@@ -60,7 +62,9 @@ public static function preRenderGeneralInfo($element) {
         case 'php':
         case 'php_memory_limit':
           $element['#general_info']['#' . $key] = $requirement;
-          unset($element['#requirements'][$key]);
+          if (empty($requirement['severity']) || $requirement['severity'] == REQUIREMENT_OK) {
+            unset($element['#requirements'][$key]);
+          }
           break;
       }
     }
diff --git a/core/modules/system/tests/src/Functional/System/StatusTest.php b/core/modules/system/tests/src/Functional/System/StatusTest.php
index cb81d05..94ef400 100644
--- a/core/modules/system/tests/src/Functional/System/StatusTest.php
+++ b/core/modules/system/tests/src/Functional/System/StatusTest.php
@@ -5,6 +5,7 @@
 use Drupal\Core\Url;
 use Drupal\Tests\BrowserTestBase;
 use Drupal\system\SystemRequirements;
+use Drupal\Core\StringTranslation\PluralTranslatableMarkup;
 
 /**
  * Tests output on the status overview page.
@@ -91,4 +92,28 @@ public function testStatusPage() {
     $this->assertResponse(200, 'The phpinfo page is reachable.');
   }
 
+  /**
+   * Tests that the Error and Warning element counts match the displayed value.
+   */
+  public function testElementCount() {
+    // Trigger "update notifications are not enabled" warning:
+    \Drupal::service('module_installer')->uninstall(['update']);
+
+    // Trigger "cron has not run recently" error:
+    \Drupal::state()->set('install_time', REQUEST_TIME);
+    \Drupal::state()->set('system.cron_last', 0);
+
+    $this->drupalGet('admin/reports/status');
+
+    $error_elements = $this->cssSelect('.system-status-report__status-icon--error');
+    $this->assertNotEqual(count($error_elements), 0, 'Errors are listed on the page.');
+    $expected_text = new PluralTranslatableMarkup(count($error_elements), t('Error'), t('Errors'));
+    $this->assertText((string)$expected_text);
+
+    $warning_elements = $this->cssSelect('.system-status-report__status-icon--warning');
+    $this->assertNotEqual(count($warning_elements), 0, 'Warnings are listed on the page.');
+    $expected_text = new PluralTranslatableMarkup(count($warning_elements), t('Warning'), t('Warnings'));
+    $this->assertText((string)$expected_text);
+  }
+
 }
