diff --git a/lib/compat/wordpress-6.3/footnotes.php b/lib/compat/wordpress-6.3/footnotes.php
index 963f1f3bb301f..45f4c74b05e37 100644
--- a/lib/compat/wordpress-6.3/footnotes.php
+++ b/lib/compat/wordpress-6.3/footnotes.php
@@ -1,11 +1,24 @@
\s*\d+\s*_';
+ static $footnote_pattern = '_\s*\d+\s*_';
return preg_replace( $footnote_pattern, '', $content );
}