Bug #86569
closed
Respect no_index while creating canonical and hreflang tags
Added by Marc Hirdes about 6 years ago.
Updated over 5 years ago.
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.
- 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.
- Has duplicate Task #86545: Make canonical and hreflang optional added
- Status changed from Accepted to Under Review
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
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?
- Status changed from Resolved to Closed
Also available in: Atom
PDF