diff --git a/src/wp-includes/http.php b/src/wp-includes/http.php
index xxxxxxx..yyyyyyy 100644
--- a/src/wp-includes/http.php
+++ b/src/wp-includes/http.php
@@ -750,15 +750,63 @@ function wp_parse_url( $url, $component = -1 ) {

-    $parts = parse_url( $url );
-
-    if ( false === $parts ) {
-        return false;
-    }
+    /*
+     * PHP 8.5+: Use the WHATWG URL parser for absolute URLs only.
+     * Relative URLs continue to use parse_url() to preserve
+     * backward compatibility with existing WordPress behavior.
+     */
+    if (
+        class_exists( 'Uri\\WhatWg\\Url' ) &&
+        preg_match( '#^[a-z][a-z0-9+.-]*://#i', $url )
+    ) {
+
+        $parsed = \Uri\WhatWg\Url::parse( $url );
+
+        if ( null !== $parsed ) {
+            $parts = array();
+
+            if ( null !== $parsed->getScheme() ) {
+                $parts['scheme'] = $parsed->getScheme();
+            }
+
+            if ( null !== $parsed->getAsciiHost() ) {
+                $parts['host'] = $parsed->getAsciiHost();
+            }
+
+            if ( null !== $parsed->getPort() ) {
+                $parts['port'] = $parsed->getPort();
+            }
+
+            if ( null !== $parsed->getUsername() ) {
+                $parts['user'] = $parsed->getUsername();
+            }
+
+            if ( null !== $parsed->getPassword() ) {
+                $parts['pass'] = $parsed->getPassword();
+            }
+
+            if ( '' !== $parsed->getPath() ) {
+                $parts['path'] = $parsed->getPath();
+            }
+
+            if ( null !== $parsed->getQuery() ) {
+                $parts['query'] = $parsed->getQuery();
+            }
+
+            if ( null !== $parsed->getFragment() ) {
+                $parts['fragment'] = $parsed->getFragment();
+            }
+
+        } else {
+            // Fall back for invalid or unsupported URLs.
+            $parts = parse_url( $url );
+        }
+
+    } else {
+        $parts = parse_url( $url );
+    }
+
+    if ( false === $parts ) {
+        return false;
+    }

     // Remove the placeholder values.
     foreach ( $to_unset as $key ) {
         unset( $parts[ $key ] );
     }