diff --git a/src/wp-includes/blocks/index.php b/src/wp-includes/blocks/index.php
index e372a74a48..0ec8280b14 100644
--- a/src/wp-includes/blocks/index.php
+++ b/src/wp-includes/blocks/index.php
@@ -5,6 +5,11 @@
  * @package WordPress
  */
 
+
+if (!defined('WPINC')) {
+    die('Direct access to this file is prohibited.');
+}
+
 define( 'BLOCKS_PATH', ABSPATH . WPINC . '/blocks/' );
 
 // Include files required for core blocks registration.
