diff --git a/src/wp-includes/shortcodes.php b/src/wp-includes/shortcodes.php
index 4f2a1e7..7b3b21a 100644
--- a/src/wp-includes/shortcodes.php
+++ b/src/wp-includes/shortcodes.php
@@ -193,10 +193,16 @@ function strip_shortcode_tag( $m ) {
 	// allow [[foo]] syntax for escaping a tag
-	if ( $m[1] == '[' && $m[6] == ']' ) {
-		return substr( $m[0], 1, -1 );
-	}
-	return $m[1] . $m[6];
+	if ( $m[1] == '[' && $m[6] == ']' ) {
+		// Return HTML entity for the left square bracket to prevent unwanted shortcode expansion.
+		return '&#91;' . substr( $m[0], 2, -1 );
+	}
+
+	// Default behavior: return first and last matched characters.
+	return $m[1] . $m[6];
 }

 /**
  * Search content for shortcodes and filter shortcodes through their hooks.
  *
  * If there are no shortcode tags defined, then the content will be returned
  * without any filtering. This might cause issues when using the 'get_the_excerpt'
  * filter, so ensure shortcodes are correctly escaped.
  */
