WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 3 years ago

#40032 new defect (bug)

Automatic redirects with _wp_old_slug won't mantain GET parameters if present

Reported by: DrLightman Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Permalinks Keywords: has-patch needs-testing
Focuses: Cc:
PR Number:

Description

If for example links come up with GET parameters, for example utm parameters for analytics, they get stripped before the redirect.

post_name = 'new-slug'
_wp_old_slug = 'old-slug'

http://example.org/old-slug/?utm_source=test1&utm_medium=test2&utm_campaign=test3

Wordpress will build the link for the redirect to the new slug without any GET parameter:

http://example.org/new-slug/

I think it should mantein them instead:

http://example.org/new-slug/?utm_source=test1&utm_medium=test2&utm_campaign=test3

I'm not even sure if this should be classified as a bug, if it's the correct behaviour or not. I'll let you judge.

Attachments (1)

40032.patch (562 bytes) - added by desrosj 3 years ago.
Preserve $_GET params on _wp_old_slug redirects

Download all attachments as: .zip

Change History (3)

#1 @SergeyBiryukov
3 years ago

  • Summary changed from Automatic redirects with _wp_old_slug won't mantein GET parameters if present to Automatic redirects with _wp_old_slug won't mantain GET parameters if present

@desrosj
3 years ago

Preserve $_GET params on _wp_old_slug redirects

#2 @desrosj
3 years ago

  • Keywords has-patch needs-testing added
Note: See TracTickets for help on using tickets.