[wp-trac] [WordPress Trac] #65267: Preserve Query Strings on Old-Slug Redirects, If Any

WordPress Trac noreply at wordpress.org
Tue May 19 07:50:12 UTC 2026


#65267: Preserve Query Strings on Old-Slug Redirects, If Any
--------------------------+-----------------------------
 Reporter:  mkormendy     |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Query         |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 WordPress's wp_old_slug_redirect() (wp-includes/query.php) builds its
 redirect destination via get_permalink() and drops the original request's
 query string entirely. This is unexpected, and the option to have query
 parameters be preserved to the new destination should be available.

 A valid usage case is with advertising campaigns that link to old urls
 containing URL parameters for tracking. Advertisements may exist in
 permanent form (on paper) with a relevant code in the query string of the
 URL. If someone modifies the URL in WordPress and wp_old_slug_redirect()
 handles the redirect and points to the updated slug, then those query
 parameters should be passed along.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/65267>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list