diff --git package-lock.json package-lock.json
index bc1f2273b6..0a113e3bbc 100644
--- package-lock.json
+++ package-lock.json
@@ -2116,9 +2116,9 @@
 			}
 		},
 		"@sinonjs/fake-timers": {
-			"version": "6.0.0",
-			"resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-6.0.0.tgz",
-			"integrity": "sha512-atR1J/jRXvQAb47gfzSK8zavXy7BcpnYq21ALon0U99etu99vsir0trzIO3wpeLtW+LLVY6X7EkfVTbjGSH8Ww==",
+			"version": "6.0.1",
+			"resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz",
+			"integrity": "sha512-MZPUxrmFubI36XS1DI3qmI0YdN1gks62JtFZvxR67ljjSNCeK6U08Zx4msEWOXuofgqUt6zPHSi1H9fbjR/NRA==",
 			"dev": true,
 			"requires": {
 				"@sinonjs/commons": "^1.7.0"
@@ -12817,9 +12817,9 @@
 			}
 		},
 		"grunt-rtlcss": {
-			"version": "2.0.1",
-			"resolved": "https://registry.npmjs.org/grunt-rtlcss/-/grunt-rtlcss-2.0.1.tgz",
-			"integrity": "sha1-6eYc5DdAY5f546Sxv2aeR+cf/MM=",
+			"version": "2.0.2",
+			"resolved": "https://registry.npmjs.org/grunt-rtlcss/-/grunt-rtlcss-2.0.2.tgz",
+			"integrity": "sha512-WbI2thnwlF04N+xvJu+NxqEaCyPuLyar196SYhEQFZ2EJHkOS8YYE+Zkh+X9cWhwAtKp7ZEpR/IKXcyQggOIsQ==",
 			"dev": true,
 			"requires": {
 				"chalk": "^1.0.0",
@@ -17624,9 +17624,9 @@
 			"dev": true
 		},
 		"nise": {
-			"version": "4.0.3",
-			"resolved": "https://registry.npmjs.org/nise/-/nise-4.0.3.tgz",
-			"integrity": "sha512-EGlhjm7/4KvmmE6B/UFsKh7eHykRl9VH+au8dduHLCyWUO/hr7+N+WtTvDUwc9zHuM1IaIJs/0lQ6Ag1jDkQSg==",
+			"version": "4.0.4",
+			"resolved": "https://registry.npmjs.org/nise/-/nise-4.0.4.tgz",
+			"integrity": "sha512-bTTRUNlemx6deJa+ZyoCUTRvH3liK5+N6VQZ4NIw90AgDXY6iPnsqplNFf6STcj+ePk0H/xqxnP75Lr0J0Fq3A==",
 			"dev": true,
 			"requires": {
 				"@sinonjs/commons": "^1.7.0",
@@ -22216,13 +22216,13 @@
 			}
 		},
 		"sinon": {
-			"version": "9.0.1",
-			"resolved": "https://registry.npmjs.org/sinon/-/sinon-9.0.1.tgz",
-			"integrity": "sha512-iTTyiQo5T94jrOx7X7QLBZyucUJ2WvL9J13+96HMfm2CGoJYbIPqRfl6wgNcqmzk0DI28jeGx5bUTXizkrqBmg==",
+			"version": "9.0.2",
+			"resolved": "https://registry.npmjs.org/sinon/-/sinon-9.0.2.tgz",
+			"integrity": "sha512-0uF8Q/QHkizNUmbK3LRFqx5cpTttEVXudywY9Uwzy8bTfZUhljZ7ARzSxnRHWYWtVTeh4Cw+tTb3iU21FQVO9A==",
 			"dev": true,
 			"requires": {
-				"@sinonjs/commons": "^1.7.0",
-				"@sinonjs/fake-timers": "^6.0.0",
+				"@sinonjs/commons": "^1.7.2",
+				"@sinonjs/fake-timers": "^6.0.1",
 				"@sinonjs/formatio": "^5.0.1",
 				"@sinonjs/samsam": "^5.0.3",
 				"diff": "^4.0.2",
@@ -22230,26 +22230,20 @@
 				"supports-color": "^7.1.0"
 			},
 			"dependencies": {
+				"@sinonjs/commons": {
+					"version": "1.8.0",
+					"resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.0.tgz",
+					"integrity": "sha512-wEj54PfsZ5jGSwMX68G8ZXFawcSglQSXqCftWX3ec8MDUzQdHgcKvw97awHbY0efQEL5iKUOAmmVtoYgmrSG4Q==",
+					"dev": true,
+					"requires": {
+						"type-detect": "4.0.8"
+					}
+				},
 				"diff": {
 					"version": "4.0.2",
 					"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
 					"integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==",
 					"dev": true
-				},
-				"has-flag": {
-					"version": "4.0.0",
-					"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
-					"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
-					"dev": true
-				},
-				"supports-color": {
-					"version": "7.1.0",
-					"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz",
-					"integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==",
-					"dev": true,
-					"requires": {
-						"has-flag": "^4.0.0"
-					}
 				}
 			}
 		},
@@ -24148,9 +24142,9 @@
 					}
 				},
 				"tar-stream": {
-					"version": "2.1.2",
-					"resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.1.2.tgz",
-					"integrity": "sha512-UaF6FoJ32WqALZGOIAApXx+OdxhekNMChu6axLJR85zMMjXKWFGjbIRe+J6P4UnRGg9rAwWvbTT0oI7hD/Un7Q==",
+					"version": "2.1.3",
+					"resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.1.3.tgz",
+					"integrity": "sha512-Z9yri56Dih8IaK8gncVPx4Wqt86NDmQTSh49XLZgjWpGZL9GK9HKParS2scqHCC4w6X9Gh2jwaU45V47XTKwVA==",
 					"dev": true,
 					"requires": {
 						"bl": "^4.0.1",
@@ -24696,22 +24690,10 @@
 			"dev": true
 		},
 		"uglify-js": {
-			"version": "3.6.0",
-			"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.0.tgz",
-			"integrity": "sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg==",
-			"dev": true,
-			"requires": {
-				"commander": "~2.20.0",
-				"source-map": "~0.6.1"
-			},
-			"dependencies": {
-				"source-map": {
-					"version": "0.6.1",
-					"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
-					"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
-					"dev": true
-				}
-			}
+			"version": "3.10.0",
+			"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.10.0.tgz",
+			"integrity": "sha512-Esj5HG5WAyrLIdYU74Z3JdG2PxdIusvj6IWHMtlyESxc7kcDz7zYlYjpnSokn1UbpV0d/QX9fan7gkCNd/9BQA==",
+			"dev": true
 		},
 		"uglify-to-browserify": {
 			"version": "1.0.2",
diff --git package.json package.json
index 8c1e589be4..959900f90b 100644
--- package.json
+++ package.json
@@ -56,7 +56,7 @@
 		"grunt-patch-wordpress": "~2.0.0",
 		"grunt-postcss": "~0.9.0",
 		"grunt-replace-lts": "~1.1.0",
-		"grunt-rtlcss": "~2.0.1",
+		"grunt-rtlcss": "2.0.2",
 		"grunt-sass": "~3.1.0",
 		"grunt-webpack": "^3.1.3",
 		"ink-docstrap": "1.3.2",
@@ -67,10 +67,10 @@
 		"prettier": "npm:wp-prettier@2.0.5",
 		"puppeteer": "npm:puppeteer-core@3.0.0",
 		"qunit": "~2.9.0",
-		"sinon": "~9.0.0",
+		"sinon": "9.0.2",
 		"sinon-test": "~3.0.0",
 		"source-map-loader": "^0.2.4",
-		"uglify-js": "^3.6.0",
+		"uglify-js": "3.10.0",
 		"uglifyjs-webpack-plugin": "2.2.0",
 		"uuid": "8.2.0",
 		"wait-on": "3.3.0",
diff --git src/wp-includes/assets/script-loader-packages.php src/wp-includes/assets/script-loader-packages.php
index 34122d8bb7..4a21fc038d 100644
--- src/wp-includes/assets/script-loader-packages.php
+++ src/wp-includes/assets/script-loader-packages.php
@@ -1 +1 @@
-<?php return array('a11y.js' => array('dependencies' => array('wp-dom-ready', 'wp-i18n', 'wp-polyfill'), 'version' => '6d98587879c8c19080b1e3a855e946be'), 'annotations.js' => array('dependencies' => array('lodash', 'wp-data', 'wp-hooks', 'wp-i18n', 'wp-polyfill', 'wp-rich-text'), 'version' => '260b045f4c676d091d7e8a97723357dc'), 'api-fetch.js' => array('dependencies' => array('wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => '74653372c4595d464e30438faccf7290'), 'autop.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'e3a7061e1087f5cf077a68aeaf0ea714'), 'blob.js' => array('dependencies' => array('wp-polyfill'), 'version' => '27195f29e36179999f6e1fa7d1f079b3'), 'block-directory.js' => array('dependencies' => array('lodash', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-data-controls', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '8a4c748538664b3d2a3d81670e5308df'), 'block-editor.js' => array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-blob', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-shortcode', 'wp-token-list', 'wp-url', 'wp-viewport', 'wp-wordcount'), 'version' => 'faf18017b6902eb340b24b9f18a574f3'), 'block-library.js' => array('dependencies' => array('lodash', 'moment', 'react', 'wp-api-fetch', 'wp-autop', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-viewport'), 'version' => '4990ef5b5ef7063ecd4415396556fa5a'), 'block-serialization-default-parser.js' => array('dependencies' => array('wp-polyfill'), 'version' => '27585bbfe083d705c915c21bf47047df'), 'blocks.js' => array('dependencies' => array('lodash', 'wp-autop', 'wp-blob', 'wp-block-serialization-default-parser', 'wp-compose', 'wp-data', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-shortcode'), 'version' => 'f8c36e24ce9e4fa0d878d93384a12c76'), 'components.js' => array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wp-a11y', 'wp-compose', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-warning'), 'version' => '85abda5cd53db6f40d14a256d1bd4740'), 'compose.js' => array('dependencies' => array('lodash', 'react', 'wp-element', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-priority-queue'), 'version' => 'd544688da01336df14c1fb668a60fa88'), 'core-data.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-blocks', 'wp-data', 'wp-data-controls', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-url'), 'version' => 'fd10eb49751e8e9638e48e34947288ed'), 'data.js' => array('dependencies' => array('lodash', 'react', 'wp-compose', 'wp-deprecated', 'wp-element', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-priority-queue', 'wp-redux-routine'), 'version' => 'bdecf088172566c402cb7e60959c75d4'), 'data-controls.js' => array('dependencies' => array('wp-api-fetch', 'wp-data', 'wp-polyfill'), 'version' => 'ea191e898b70efcaa0314934334db8d2'), 'date.js' => array('dependencies' => array('moment', 'wp-polyfill'), 'version' => '71ad0d58f6b8efd48fffc625b1968750'), 'deprecated.js' => array('dependencies' => array('wp-hooks', 'wp-polyfill'), 'version' => '26aefabb46263ab5dac6d7f6c63b664c'), 'dom.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => 'e54be95ed4c9e5422fcf44a2cee53217'), 'dom-ready.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'a6586b64552c9c6924b8093e9ef4f74e'), 'edit-post.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-viewport', 'wp-warning'), 'version' => 'db891ec5e87b386b6015b2520fd4ad7d'), 'editor.js' => array('dependencies' => array('lodash', 'react', 'wp-api-fetch', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-deprecated', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-viewport', 'wp-wordcount'), 'version' => '473d94ac60336cbc66926d8e2f6ade43'), 'element.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-escape-html', 'wp-polyfill'), 'version' => 'b2a51f1f50dee6f6fb90f1dd39a4b151'), 'escape-html.js' => array('dependencies' => array('wp-polyfill'), 'version' => '11a9ed20aa0e5b49a24e416455d2311e'), 'format-library.js' => array('dependencies' => array('lodash', 'wp-block-editor', 'wp-components', 'wp-data', 'wp-dom', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-url'), 'version' => '8f528a8c90b4108d003d53908a3c42ed'), 'hooks.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'd3b8b40265078ab4bf9a60e4be8c928e'), 'html-entities.js' => array('dependencies' => array('wp-polyfill'), 'version' => '5f0f2fc8f6cde41ab343549aa0b50183'), 'i18n.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'c818ff88cdaa24964e36a1c89e447c77'), 'is-shallow-equal.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'b2327d0572e72da49f9e26cc3a53de34'), 'keyboard-shortcuts.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-data', 'wp-keycodes', 'wp-polyfill'), 'version' => '0dca10a23ad5f1fa6c5ea705402ac449'), 'keycodes.js' => array('dependencies' => array('lodash', 'wp-i18n', 'wp-polyfill'), 'version' => '8fa475945c1ee2fa9fbf41b45c02a131'), 'list-reusable-blocks.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '91fd753476dc10e1f35ebaee4cbb95ff'), 'media-utils.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-blob', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '21f10d37b05bd05ac894d5fc2329378e'), 'notices.js' => array('dependencies' => array('lodash', 'wp-data', 'wp-polyfill'), 'version' => 'c8419832e15a611ba10b8c9db5b628bf'), 'nux.js' => array('dependencies' => array('lodash', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => '9a0d3d4ed32b44e6c499e6d90e80aa1a'), 'plugins.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-polyfill', 'wp-primitives'), 'version' => '96bfd27bc78c4cab5ff0f524fa2f9318'), 'primitives.js' => array('dependencies' => array('wp-element', 'wp-polyfill'), 'version' => 'ec81efc9895bf6b2e092f8e56bc7aec4'), 'priority-queue.js' => array('dependencies' => array('wp-polyfill'), 'version' => '21998ef9ac35858b8751c443f5003831'), 'redux-routine.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => 'f85fd85702ab43e4cbf75c2b252c19bd'), 'rich-text.js' => array('dependencies' => array('lodash', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-escape-html', 'wp-keycodes', 'wp-polyfill'), 'version' => 'c98ed3bbbe1c848f34d82b1572d6dadf'), 'server-side-render.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => '4ef0a464287b500da6136547cfdaa558'), 'shortcode.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '0f4a8551daa990e80114889793034ff6'), 'token-list.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '8c1de0af2850ea512bf7ee4ea8a6af09'), 'url.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '5cfad922551470f0d04552a83d5e7eb4'), 'viewport.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-data', 'wp-element', 'wp-polyfill'), 'version' => 'de07809632bb717b3bef9fb526a17f20'), 'warning.js' => array('dependencies' => array('wp-polyfill'), 'version' => '202ac16e99afe7c33c257b248625a947'), 'wordcount.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => 'ababa914c8610cc872482756daceab10'));
\ No newline at end of file
+<?php return array('a11y.js' => array('dependencies' => array('wp-dom-ready', 'wp-i18n', 'wp-polyfill'), 'version' => '6d98587879c8c19080b1e3a855e946be'), 'annotations.js' => array('dependencies' => array('lodash', 'wp-data', 'wp-hooks', 'wp-i18n', 'wp-polyfill', 'wp-rich-text'), 'version' => '260b045f4c676d091d7e8a97723357dc'), 'api-fetch.js' => array('dependencies' => array('wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => '74653372c4595d464e30438faccf7290'), 'autop.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'e3a7061e1087f5cf077a68aeaf0ea714'), 'blob.js' => array('dependencies' => array('wp-polyfill'), 'version' => '27195f29e36179999f6e1fa7d1f079b3'), 'block-directory.js' => array('dependencies' => array('lodash', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-data-controls', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '8a4c748538664b3d2a3d81670e5308df'), 'block-editor.js' => array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-blob', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-shortcode', 'wp-token-list', 'wp-url', 'wp-viewport', 'wp-wordcount'), 'version' => 'faf18017b6902eb340b24b9f18a574f3'), 'block-library.js' => array('dependencies' => array('lodash', 'moment', 'react', 'wp-api-fetch', 'wp-autop', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-viewport'), 'version' => '4990ef5b5ef7063ecd4415396556fa5a'), 'block-serialization-default-parser.js' => array('dependencies' => array('wp-polyfill'), 'version' => '27585bbfe083d705c915c21bf47047df'), 'blocks.js' => array('dependencies' => array('lodash', 'wp-autop', 'wp-blob', 'wp-block-serialization-default-parser', 'wp-compose', 'wp-data', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-shortcode'), 'version' => 'f8c36e24ce9e4fa0d878d93384a12c76'), 'components.js' => array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wp-a11y', 'wp-compose', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-warning'), 'version' => '7698dad1be7c7c111147883139ee3d9e'), 'compose.js' => array('dependencies' => array('lodash', 'react', 'wp-element', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-priority-queue'), 'version' => 'd544688da01336df14c1fb668a60fa88'), 'core-data.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-blocks', 'wp-data', 'wp-data-controls', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-url'), 'version' => 'fd10eb49751e8e9638e48e34947288ed'), 'data.js' => array('dependencies' => array('lodash', 'react', 'wp-compose', 'wp-deprecated', 'wp-element', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-priority-queue', 'wp-redux-routine'), 'version' => 'bdecf088172566c402cb7e60959c75d4'), 'data-controls.js' => array('dependencies' => array('wp-api-fetch', 'wp-data', 'wp-polyfill'), 'version' => 'ea191e898b70efcaa0314934334db8d2'), 'date.js' => array('dependencies' => array('moment', 'wp-polyfill'), 'version' => '71ad0d58f6b8efd48fffc625b1968750'), 'deprecated.js' => array('dependencies' => array('wp-hooks', 'wp-polyfill'), 'version' => '26aefabb46263ab5dac6d7f6c63b664c'), 'dom.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => 'e54be95ed4c9e5422fcf44a2cee53217'), 'dom-ready.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'a6586b64552c9c6924b8093e9ef4f74e'), 'edit-post.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-viewport', 'wp-warning'), 'version' => 'db891ec5e87b386b6015b2520fd4ad7d'), 'editor.js' => array('dependencies' => array('lodash', 'react', 'wp-api-fetch', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-deprecated', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-viewport', 'wp-wordcount'), 'version' => '473d94ac60336cbc66926d8e2f6ade43'), 'element.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-escape-html', 'wp-polyfill'), 'version' => 'b2a51f1f50dee6f6fb90f1dd39a4b151'), 'escape-html.js' => array('dependencies' => array('wp-polyfill'), 'version' => '11a9ed20aa0e5b49a24e416455d2311e'), 'format-library.js' => array('dependencies' => array('lodash', 'wp-block-editor', 'wp-components', 'wp-data', 'wp-dom', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-url'), 'version' => '8f528a8c90b4108d003d53908a3c42ed'), 'hooks.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'd3b8b40265078ab4bf9a60e4be8c928e'), 'html-entities.js' => array('dependencies' => array('wp-polyfill'), 'version' => '5f0f2fc8f6cde41ab343549aa0b50183'), 'i18n.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'c818ff88cdaa24964e36a1c89e447c77'), 'is-shallow-equal.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'b2327d0572e72da49f9e26cc3a53de34'), 'keyboard-shortcuts.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-data', 'wp-keycodes', 'wp-polyfill'), 'version' => '0dca10a23ad5f1fa6c5ea705402ac449'), 'keycodes.js' => array('dependencies' => array('lodash', 'wp-i18n', 'wp-polyfill'), 'version' => '8fa475945c1ee2fa9fbf41b45c02a131'), 'list-reusable-blocks.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '91fd753476dc10e1f35ebaee4cbb95ff'), 'media-utils.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-blob', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '21f10d37b05bd05ac894d5fc2329378e'), 'notices.js' => array('dependencies' => array('lodash', 'wp-data', 'wp-polyfill'), 'version' => 'c8419832e15a611ba10b8c9db5b628bf'), 'nux.js' => array('dependencies' => array('lodash', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => '9a0d3d4ed32b44e6c499e6d90e80aa1a'), 'plugins.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-polyfill', 'wp-primitives'), 'version' => '96bfd27bc78c4cab5ff0f524fa2f9318'), 'primitives.js' => array('dependencies' => array('wp-element', 'wp-polyfill'), 'version' => 'ec81efc9895bf6b2e092f8e56bc7aec4'), 'priority-queue.js' => array('dependencies' => array('wp-polyfill'), 'version' => '21998ef9ac35858b8751c443f5003831'), 'redux-routine.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => 'f85fd85702ab43e4cbf75c2b252c19bd'), 'rich-text.js' => array('dependencies' => array('lodash', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-escape-html', 'wp-keycodes', 'wp-polyfill'), 'version' => 'c98ed3bbbe1c848f34d82b1572d6dadf'), 'server-side-render.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => '4ef0a464287b500da6136547cfdaa558'), 'shortcode.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '0f4a8551daa990e80114889793034ff6'), 'token-list.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '8c1de0af2850ea512bf7ee4ea8a6af09'), 'url.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '5cfad922551470f0d04552a83d5e7eb4'), 'viewport.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-data', 'wp-element', 'wp-polyfill'), 'version' => 'de07809632bb717b3bef9fb526a17f20'), 'warning.js' => array('dependencies' => array('wp-polyfill'), 'version' => '202ac16e99afe7c33c257b248625a947'), 'wordcount.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => 'ababa914c8610cc872482756daceab10'));
\ No newline at end of file
diff --git src/wp-includes/sitemaps.php src/wp-includes/sitemaps.php
index 8678993dbd..9600540156 100644
--- src/wp-includes/sitemaps.php
+++ src/wp-includes/sitemaps.php
@@ -17,26 +17,13 @@
  *
  * @global WP_Sitemaps $wp_sitemaps Global Core Sitemaps instance.
  *
- * @return WP_Sitemaps|null Sitemaps instance, or null if sitemaps are disabled.
+ * @return WP_Sitemaps Sitemaps instance.
  */
 function wp_sitemaps_get_server() {
 	global $wp_sitemaps;
 
 	$is_enabled = (bool) get_option( 'blog_public' );
 
-	/**
-	 * Filters whether XML Sitemaps are enabled or not.
-	 *
-	 * @since 5.5.0
-	 *
-	 * @param bool $is_enabled Whether XML Sitemaps are enabled or not. Defaults to true for public sites.
-	 */
-	$is_enabled = (bool) apply_filters( 'wp_sitemaps_enabled', $is_enabled );
-
-	if ( ! $is_enabled ) {
-		return null;
-	}
-
 	// If there isn't a global instance, set and bootstrap the sitemaps system.
 	if ( empty( $wp_sitemaps ) ) {
 		$wp_sitemaps = new WP_Sitemaps();
diff --git src/wp-includes/sitemaps/class-wp-sitemaps.php src/wp-includes/sitemaps/class-wp-sitemaps.php
index 918220317b..656fd58416 100644
--- src/wp-includes/sitemaps/class-wp-sitemaps.php
+++ src/wp-includes/sitemaps/class-wp-sitemaps.php
@@ -56,19 +56,51 @@ class WP_Sitemaps {
 	/**
 	 * Initiates all sitemap functionality.
 	 *
+	 * If sitemaps are disabled, only the rewrite rules will be registered
+	 * by this method, in order to properly send 404s.
+	 *
 	 * @since 5.5.0
 	 */
 	public function init() {
 		// These will all fire on the init hook.
 		$this->register_rewrites();
+
+		add_action( 'template_redirect', array( $this, 'render_sitemaps' ) );
+
+		if ( ! $this->sitemaps_enabled() ) {
+			return;
+		}
+
 		$this->register_sitemaps();
 
 		// Add additional action callbacks.
-		add_action( 'template_redirect', array( $this, 'render_sitemaps' ) );
 		add_filter( 'pre_handle_404', array( $this, 'redirect_sitemapxml' ), 10, 2 );
 		add_filter( 'robots_txt', array( $this, 'add_robots' ), 0, 2 );
 	}
 
+	/**
+	 * Determines whether sitemaps are enabled or not.
+	 *
+	 * @since 5.5.0
+	 *
+	 * @return bool Whether sitemaps are enabled.
+	 */
+	public function sitemaps_enabled() {
+		$is_enabled = (bool) get_option( 'blog_public' );
+
+		/**
+		 * Filters whether XML Sitemaps are enabled or not.
+		 *
+		 * When XML Sitemaps are disabled via this filter, rewrite rules are still in place to ensure a 404 is returned.
+		 * @see WP_Sitemaps->register_rewrites().
+		 *
+		 * @since 5.5.0
+		 *
+		 * @param bool $is_enabled Whether XML Sitemaps are enabled or not. Defaults to true for public sites.
+		 */
+		return (bool) apply_filters( 'wp_sitemaps_enabled', $is_enabled );
+	}
+
 	/**
 	 * Registers and sets up the functionality for all supported sitemaps.
 	 *
@@ -143,6 +175,7 @@ class WP_Sitemaps {
 	 * @global WP_Query $wp_query WordPress Query object.
 	 */
 	public function render_sitemaps() {
+		/* @var WP_Query $wp_query */
 		global $wp_query;
 
 		$sitemap         = sanitize_text_field( get_query_var( 'sitemap' ) );
@@ -155,6 +188,12 @@ class WP_Sitemaps {
 			return;
 		}
 
+		if ( ! $this->sitemaps_enabled() ) {
+			$wp_query->set_404();
+			status_header( 404 );
+			return;
+		}
+
 		// Render stylesheet if this is stylesheet route.
 		if ( $stylesheet_type ) {
 			$stylesheet = new WP_Sitemaps_Stylesheet();
@@ -186,6 +225,7 @@ class WP_Sitemaps {
 		// Force a 404 and bail early if no URLs are present.
 		if ( empty( $url_list ) ) {
 			$wp_query->set_404();
+			status_header( 404 );
 			return;
 		}
 
