Making WordPress.org

Opened 4 years ago

Closed 20 months ago

#5290 closed defect (bug) (fixed)

Requests containing 'cat=-1' omit canonical (and hreflang) tags

Reported by: jonoaldersonwp's profile jonoaldersonwp Owned by:
Milestone: Priority: normal
Component: General Keywords: seo
Cc:

Description (last modified by dd32)

Requests such as https://wordpress.org/plugins/tags/web-application-firewall/?cat=-1 and https://wordpress.org/themes/tags/blog/?example=example&cat=-1 omit canonical URL tag and hreflang tags.

These should be (re)included, and the parameter ignored.

Change History (5)

#1 @dd32
4 years ago

In 9992:

Theme Directory: Remove Category support.

See #5290.

#2 follow-up: @dd32
4 years ago

  • Description modified (diff)

Unfortunately ?cat=-1 is a valid request, as is /tag/tagname/?cat=-1234, which is just as valid as /tag/tagname/?category_name=catname

This is an unfortunate scenario where WordPress's flexibility is incredibly hard to handle.

The challenge with multi-taxonomy queries like this, is which is the canonical? /tag/tagname/?category_name=catname or /category/catname/?tag=tagname?

If the QV should just be excluded from the canonicalisation, the further question that's raised is "Does what the canonical is actually set to matter at all? Should it just be set to the homepage for a multi-taxonomy query if one should be ignored?"

#3 @dd32
4 years ago

In 9996:

Plugin Directory: Ignore any query vars that the directory doesn't need/use.

See #5290.

#4 in reply to: ↑ 2 @jonoaldersonwp
4 years ago

Replying to dd32:

Unfortunately ?cat=-1 is a valid request, as is /tag/tagname/?cat=-1234, which is just as valid as /tag/tagname/?category_name=catname

This is an unfortunate scenario where WordPress's flexibility is incredibly hard to handle.

The challenge with multi-taxonomy queries like this, is which is the canonical? /tag/tagname/?category_name=catname or /category/catname/?tag=tagname?

If the QV should just be excluded from the canonicalisation, the further question that's raised is "Does what the canonical is actually set to matter at all? Should it just be set to the homepage for a multi-taxonomy query if one should be ignored?"

Yeah, this is nuanced and messy. Really, it shouldn't be possible to cross-query to the nth degree like that. In an ideal world we'd define all of the intersecting meta robots and canonical logic for every variations; but we have bigger fish to fry. Just need to make it less-broken for now, until we run out of other fires to put out! :)

#5 @jonoaldersonwp
20 months ago

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.