diff --git a/src/wp-includes/html-api/class-wp-html-token.php b/src/wp-includes/html-api/class-wp-html-token.php
index f6edd5235579d..86dd7658cfcee 100644
--- a/src/wp-includes/html-api/class-wp-html-token.php
+++ b/src/wp-includes/html-api/class-wp-html-token.php
@@ -94,4 +94,13 @@ public function __destruct() {
call_user_func( $this->on_destroy, $this->bookmark_name );
}
}
+
+ /**
+ * Wakeup magic method.
+ *
+ * @since 6.4.2
+ */
+ public function __wakeup() {
+ throw new \LogicException( __CLASS__ . ' should never be unserialized' );
+ }
}