Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Chouby

    (@chouby)

    Hi!

    I believe that you misunderstood the usage of “x-default”.

    the reserved value “x-default” is used for indicating language selectors/redirectors which are not specific to one language or region, e.g. your homepage showing a clickable map of the world.

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

    Thread Starter younk

    (@younk)

    I’m not sure that I am:

    The problem solved by the new tag is indicating your preferred “default” content when you are returned for searches in countries that you haven’t created localised content for.

    https://searchengineland.com/using-the-x-default-hreflang-tag-for-multinational-seo-default-language-opportunities-156040

    Very interesting article:
    https://moz.com/blog/hreflang-behaviour-insights

    Example:
    x-default – https://play.google.com/store/apps/details?id=com….

    Plugin Author Chouby

    (@chouby)

    According to your quote, I should double the default language hreflang with ‘x-default’. I did not understand this from the Google post I quoted.

    In the first post, there is a link to another post from Google when we can read:

    The new x-default hreflang attribute value signals to our algorithms that this page doesn’t target any specific language or locale and is the default page when no other page is better suited.

    It does not suggest tha x-default should double another hreflang.

    Currently, Polylang uses the x-default only for the root url when it has no content (and thus is automatically redirected to the homepage in the preferred language, or default language if preferences do not match).

    However, if you want to modify this, you can code it yourself by using the ‘wp_head’ action as done by Polylang (the code is in frontend/frontend-links.php if you want some inspiration).

    Actually I’ve also found a number of other websites suggesting to double the default language hreflang with ‘x-default’, including Google itself (more or less). Here you can see John Mueller from Google suggesting it.

    I’m in a similar situation.
    My website has this url structure through Polylang
    https://www.gianniriva.com/en/ (default language)
    https://www.gianniriva.com/it/
    I don’t detect browser language for the auto-redirecting home.

    If I don’t check “Hide URL language information for default language” Polylang returns:

    <link rel="alternate" href="https://www.gianniriva.com/en/" hreflang="en" />
    <link rel="alternate" href="https://www.gianniriva.com/it/" hreflang="it" />
    <link rel="alternate" href="https://www.gianniriva.com" hreflang="x-default" />

    If I do check “Hide URL language information for default language” Polylang returns:

    <link rel="alternate" href="https://www.gianniriva.com/" hreflang="en" />
    <link rel="alternate" href="https://www.gianniriva.com/it/" hreflang="it" />

    Meaning it removes x-default.

    I’m not sure about the way to go: /en/ (default language) subfolder or not?

    Currently, Polylang uses the x-default only for the root url when it has no content (and thus is automatically redirected to the homepage in the preferred language, or default language if preferences do not match).

    Apparently, something doesn’t work as explained:
    I have disabled the language auto-redirection but when I inspect the code, the hreflang value for the root url is set to x-default instead of the default language value.
    The content of my home page is not empty (page set as homepage).
    The option to hide URL language information for default language is disabled.
    The default language is set to french in General > Site Language and in Polylang settings.
    Tested with Polylang 1.7.12

    Is it a bug or did I missed something?

    if would second that the default lang should be doubled with x-default based on that article:
    https://yoast.com/hreflang-ultimate-guide/#x-default

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Hreflang x-default missing’ is closed to new replies.