WordPress.org

Making WordPress.org

#3947 closed defect (fixed)

hreflang tag values should be derived from the canonical URL, not the request URL

Reported by: jonoaldersonwp Owned by: dd32
Milestone: Priority: high
Component: General Keywords:
Cc:

Description

Many of our pages use hreflang tags to indicate localised/translated variants. That value that they output is currently based on the request URL.

E.g., https://wordpress.org/download/?test=1234 outputs alternate URLs like https://bs.wordpress.org/download/?test=1234.

This is incorrect; the alternate values should be derived fom the requested page's canonical URL.

E.g., https://wordpress.org/download/?test=1234 should output alternate URLs like https://bs.wordpress.org/download/.

Change History (2)

#1 @tobifjellner
12 months ago

  • Summary changed from heflang tag values should be derived from the canonical URL, not the request URL to hreflang tag values should be derived from the canonical URL, not the request URL

#2 @dd32
12 months ago

  • Owner set to dd32
  • Resolution set to fixed
  • Status changed from new to closed

In 7898:

WordPress.org: hreflang: Add a default x-default hreflang tag and use the canonical URL for singular pages when possible.

Fixes #3947, #3948.

Note: See TracTickets for help on using tickets.