Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #941867

    Hello,
    I’m using your theme (enfold) for a multilingual Italian and English site.
    I activated the Polylan plugin, which indexes all the pages with hreflang, except the home page. Google returns me a crawl error for the home page due to the absence of the hreflang tag.
    How can I solve the problem ?
    I would like to insert the tag in both English and Italian for the home page.
    This is the website http://www.borgomummialla.com

    Thank you
    Lorenzo

    #941870

    Well on your starting page i see this in your head section :
    click to enlarge:

    #941873

    Before writing here, I changed the settings in Polylang, inserting the check mark:

    (The homepage URL contains the language code instead of its name or ID.)
    Maybe Google needs more time?
    I took the test here: https://technicalseo.com/seo-tools/hreflang/
    but I continue to have the error.

    Another thing.
    When I use sites with a single language, how can I add the hreflang tag to Enfold?

    Thank you

    #942040

    you can insert it via functions.php of child-theme: (guess it is italian)

    add_action('wp_head', 'insert_hreflang_info');
    function insert_hreflang_info() {
    ?>
      <link rel="alternate" href="https://www.borgomummialla.com/" hreflang="it">
    <?php
    }

    but i guess that the x-default is ok – it tells the bots that this is the default language
    and if an international visitor ( someone else than italian or english) comes to your site it is redirected to the root directory

    on my opinion this is the perfect setting !

    the error is not the setting of the hreflang but that it is redirected to the /it/ page !

    so your have here to decide what is your x-default :
    maybe you test this better ( and i think for international visitors the english is better):

    add_action('wp_head', 'insert_hreflang_info');
    function insert_hreflang_info() {
    ?>
      <link rel="alternate" href="https://www.borgomummialla.com/en/"  hreflang="x-default">
    <?php
    }

    Link: https://www.sistrix.com/ask-sistrix/onpage-optimisation/how-do-i-correctly-use-the-new-x-default-hreflang-link-attribute-for-international-targets/

    #942122

    Hi,

    Thanks for helping out and sharing @guenni007. Did you get your questions answered @lorenzofusi1976?

    Best regards,
    Rikard

    #942513

    Hi,
    I entered the code as recommended by @ guenni007 in functions.php of child-theme.

    add_action (‘wp_head’, ‘insert_hreflang_info’);
    function insert_hreflang_info () {
    ?>
       <link rel = “alternate” href = “https://www.borgomummialla.com/en/&#8221; hreflang = “x-default”>
    <? Php
    }

    But checking the url
    https://www.borgomummialla.com/it/
    on
    https://technicalseo.com/seo-tools/hreflang/

    I see that there are two x-default tags and I do not know if it’s correct.

    Also, I notice that if I insert the link intragally
    https://www.borgomummialla.com/en/&#8221; the data are returned
    if I enter “www.borgomummialla”, the data will not be returned

    Can this https redirect be a problem for Google?

    #942522

    i do not have any polylang on my testing pages.
    The head is on my opinion correct – the thing is that the page is redirected via 302
    better would be to get rid of my code above and look into polylang settings if there is any chance to manage that.

    i don’t know why polylang sets here a 302 redirect.

    Edit: there must be a checkmark for: “Hide URL language information for default language”
    than the x-default isn’t set – and i guess that should be the setting you have to choice .

    ON may WPML i can set f.e. the root url is german – and the other languages are /en, /it etc.
    In this case it makes sense that i have x-default.

    so checkmark for: “Hide URL language information for default language” and look what happens in your testing page

    #942541

    I deleted the code and put the check mark “Hide the language information from the URL for the default language”

    now it seems to work, I think it is a mandatory setting

    despite everything, in the test if I do not insert all the links with https, now returns error 301.

    can it be correct to leave everything like this?

    Thank you

    #943279

    Hi,

    Yes it can be fine, there should be no issues at all.

    Best regards,
    Basilis

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.