Review main Merged

67328[BUGFIX] Don't render hreflang tag for pages with canonical set

Richard Haeser CR +2 V +2 Normal +69 −2 updated 01/20/21, 15:33

Commit message

When a canonical link is set in the page properties, this page
or translation should not get a hreflang link in frontend as this
might send conflicting signals to search engines.

Review

  • Code review CR +2 Done
    • Georg Ringer +2
    • Guido Schmechel +1
    • Martin Kutschker +1
  • Verified V +2 Done
    • Georg Ringer +2
    • Guido Schmechel +1
    • Martin Kutschker +1
    • TYPO3com +1 CI

Issues 1

Files 3

Review log 1523

  1. Richard Haeser uploaded patch set 1 01/02/21, 09:46

  2. TYPO3com voted on patch set 1 V +1 01/02/21, 09:56 Completed build in 09m 46s on Sat, 2 Jan, 09:56 AM Test Summary: 32540 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8548

  3. Richard Haeser uploaded patch set 2 01/02/21, 10:50

  4. TYPO3com voted on patch set 2 V +1 01/02/21, 11:00 Completed build in 10m 01s on Sat, 2 Jan, 11:00 AM Test Summary: 32538 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8549

  5. Richard Haeser uploaded patch set 3 01/03/21, 19:20

  6. TYPO3com voted on patch set 3 V +1 01/03/21, 19:31 Completed build in 11m 08s on Sun, 3 Jan, 07:31 PM Test Summary: 32540 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8564

  7. Richard Haeser uploaded patch set 4 01/03/21, 21:07

  8. TYPO3com voted on patch set 4 V -1 01/03/21, 21:18 Completed build in 11m 03s on Sun, 3 Jan, 09:18 PM Test Summary: 1 of 32793 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8568

  9. TYPO3com voted on patch set 4 V +1 01/06/21, 08:18 Completed build in 09m 18s on Wed, 6 Jan, 08:18 AM Test Summary: 32563 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8672

  10. Richard Haeser uploaded patch set 5 01/07/21, 02:20

  11. TYPO3com voted on patch set 5 V -1 01/07/21, 02:30 Completed build in 09m 54s on Thu, 7 Jan, 02:30 AM Test Summary: 1 of 32812 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8713

  12. TYPO3com commented on patch set 5 01/07/21, 02:40 Completed build in 09m 42s on Thu, 7 Jan, 02:40 AM Test Summary: 2 of 32812 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8714

  13. TYPO3com voted on patch set 5 V +1 01/07/21, 02:51 Completed build in 10m 06s on Thu, 7 Jan, 02:51 AM Test Summary: 32571 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8715

  14. Guido Schmechel voted on patch set 5 V +1 CR +1 01/08/21, 08:22

  15. Martin Kutschker commented on patch set 5 01/08/21, 08:59

    Should not the hreflang point to the canonical URL of the translation?
  16. Benjamin Franzke commented on patch set 5 01/08/21, 09:26

    HrefLangGenerator.php:74

    Maybe rather "if canonical is set *and* is not equal the current URL", because as I suppose this is the real motivation for the change? (To prevent conflicts between canonical pointing to another page, while hreflang references the current page) Background: As far as I know a canonical that exactly references the *current* page + hreflang tags is not a problem, right?
  17. Richard Haeser commented on patch set 5 01/08/21, 09:42

    Reply

    See my reply to the comment of Benjamin Frankze.

    HrefLangGenerator.php:74 Reply

    hreflang in combination with canonical should be correct or you should not combine them. The problem is that more and more ways for setting hreflang or canonical and that is becoming an issue. So more changes will come in this regard, but as this is the most easy one, we start with this one. In general you just don't want to have a canonical when you have an "not-auto-generated"-hreflang link. Setting the hreflang to the canonical link might be an idea, but only when it is an internal link. And also on this topic. Every SEO specialist has its own opinion on this. IMHO we should make sure that at least core is not sending mixed signals als prevent possible issues as much as possible.
  18. Martin Kutschker commented on patch set 5 01/08/21, 15:55

    HrefLangGenerator.php:74 Reply

    If the Core doesn't generate a tag it can be (more or less) easily set by an extension. I see now the reasoning for rendering no tag rather than a wrong one.
  19. Richard Haeser commented on patch set 5 01/09/21, 09:27

    HrefLangGenerator.php:74 Reply

    Please note that the issue is way "bigger" with the combination. I'm working on a concept to make sure those two can "never" be different, but as that is most likely a breaking change, this is not something to do now. So starting with these easy things to prevent rendering possible mixed signals.
  20. Martin Kutschker voted on patch set 5 V +1 CR +1 01/09/21, 19:51

  21. Richard Haeser commented on patch set 5 01/13/21, 07:49

    Reply

    Done
  22. Georg Ringer voted on patch set 5 V +2 CR +2 01/20/21, 15:33

  23. Georg Ringer merged patch set 6 01/20/21, 15:33