Bug #86569
closedRespect no_index while creating canonical and hreflang tags
100%
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.
Updated by Richard Haeser about 6 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.
Updated by Richard Haeser about 6 years ago
- Has duplicate Task #86545: Make canonical and hreflang optional added
Updated by Gerrit Code Review about 6 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
Updated by Gerrit Code Review about 6 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
Updated by Richard Haeser about 6 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 603b6bf14918382a49c47aff04d7724fbac52919.
Updated by Benjamin Robinson about 6 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?