Skip to content

Canonical URL override works for HTTP header but not HTML <link> tag #516

Description

@Mathew-WD

Plugin version: 5.0.0
Craft version: 5.x

Setting a canonical URL override in the SEO field Advanced tab on an entry outputs the correct URL in the HTTP Link: header, but the tag in the HTML still outputs the current request URL including query string.

To reproduce:
Create an entry at /product-enquiry
In the SEO field → Advanced tab, set canonical override to https://yoursite.com/product-enquiry
Visit https://yoursite.com/product-enquiry?product=abc
Check HTTP headers — Link: header correctly shows https://yoursite.com/product-enquiry
Check page source — shows https://yoursite.com/product-enquiry?product=abc

Expected behaviour:
Both the HTTP header and the HTML tag should reflect the canonical override.
Actual behaviour
The HTTP header honours the override. The HTML tag ignores it and outputs the parameterised URL instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions