Project

General

Profile

Actions

Bug #86569

closed

Respect no_index while creating canonical and hreflang tags

Added by Marc Hirdes over 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Must have
Category:
SEO
Start date:
2018-10-04
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

If the meta tag robots is set to noindex, there should be no canonical or hreflang tags linking to this page.

The following code

<meta name="robots" content="noindex,follow"/>
<link rel="alternate" hreflang="en-US" href="https://t3master.ddev.com/"/>
<link rel="alternate" hreflang="x-default" href="https://t3master.ddev.com/"/>

<link rel="canonical" href="https://t3master.ddev.com/"/>

should look like this

<meta name="robots" content="noindex,follow"/>

Furthermore it would be great if the canonical links to an internal page, that there it's also checked, if this page can be indexed. The same with hreflang.


Related issues 1 (0 open1 closed)

Has duplicate TYPO3 Core - Task #86545: Make canonical and hreflang optionalClosedRichard Haeser2018-10-02

Actions
Actions #1

Updated by Richard Haeser over 5 years ago

  • Status changed from New to Accepted
  • Assignee set to Richard Haeser
  • Target version set to Candidate for patchlevel

Setting a canonical to a page you don't want to index, is not that smart. But it could get messed up if you set the canonical of page 1 to page 2 and afterwards page 2 will set to noindex. Build in a check if maybe a little bit too much of a "weight" in every page call because this will not happen that often. Maybe creating a feature that will report editors they have setup wrong canonicals might be a nice feature for EXT:cs_seo or EXT:yoast_seo ;-)

Removing the canonical on a noindex page is a valid point and I will fix that. Removing the hreflang-tags I will check, because it might be that the page in the other language can be indexed I guess.

Actions #2

Updated by Richard Haeser over 5 years ago

  • Has duplicate Task #86545: Make canonical and hreflang optional added
Actions #3

Updated by Gerrit Code Review over 5 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58588

Actions #4

Updated by Gerrit Code Review over 5 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58588

Actions #5

Updated by Richard Haeser over 5 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #6

Updated by Benjamin Robinson over 5 years ago

The Patch does not remove the canonical if "robots" is set to "noindex" via TypoScript, for example:

page.meta{
    # Do not index if page gets content from other page (duplicate content)
    robots.replace = 1
    robots.override = noindex, nofollow
    robots.override.if.isTrue.field = content_from_pid
}

Should we reopen this or should i create a new issue?

Actions #7

Updated by Benni Mack almost 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF