Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Missing hfreflang attribute for content's own language #114

Closed
Biont opened this issue May 26, 2015 · 1 comment
Closed

Missing hfreflang attribute for content's own language #114

Biont opened this issue May 26, 2015 · 1 comment
Assignees
Labels
Milestone

Comments

@Biont
Copy link
Member

Biont commented May 26, 2015

In Mlp_Hreflang_Header_Output::wp_head() resp. Mlp_Hreflang_Header_Output::http_header()
only the available translations are searched - excluding the current base content.
That should be included, though :

If you have multiple language versions of a URL, each language page must identify all language
versions, including itself.  For example, if your site provides content in French, English, and Spanish,
the Spanish version must include a rel="alternate" hreflang="x" link for itself in addition to links to the
French and English versions. Similarly, the English and French versions must each include the same
references to the French, English, and Spanish versions.

https://support.google.com/webmasters/answer/189077?hl=en

So maybe Mlp_Hreflang_Header_Output::get_translations() should pass array( 'include_base' => TRUE ) when fetching the available translations:

$translations = $this->language_api->get_translations();

@Biont Biont changed the title Fehlendes Hreflang-attribut für eigene Sprachversion Missing hfreflang-attribut for content's own language May 29, 2015
@Biont Biont changed the title Missing hfreflang-attribut for content's own language Missing hfreflang attribute for content's own language Jun 17, 2015
@bueltge bueltge added this to the 2.2.0 milestone Jun 17, 2015
tfrommen added a commit that referenced this issue Jun 26, 2015
@tfrommen
Copy link
Member

Tested, works, closed with f0b6e57.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants