• Resolved johnmandarine

    (@johnmandarine)


    Hello,

    A customer asked us for help with SEO problems with his website (we didn’t build this website)
    After a Semrush analysis, we founded that hreflang are incorrect. The URLs are relative when they should be absolute (the “https:” is missing)
    Do you know how to fix that issue ? (we never used your plugin)
    Kind regards

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Edson Galina Fortes

    (@glx77)

    Hi @johnmandarine,

    hope you’re fine ? Sorry for the issue you’re facing.
    Yes there is some way to fix that.
    If you htink you’re able to put your own hreflangs you can use this snippet to disable Weglot hreflangs :
    add_filter( ‘weglot_add_hreflang’, ‘__return_false’ );

    Another way is to use this snippet : add_filter( ‘weglot_href_lang’, $render );
    to modify the hreflang we generate. For exemple you can do :
    add_filter( ‘weglot_href_lang’, ‘weglot_href_lang_custom’ );
    function weglot_href_lang_custom( $render ) {
    $render = str_replace(‘//www.reed-blake.ch’, ‘https://www.reed-blake.ch’, $render);
    return $render;
    }


    Don’t hesitate if you need more help.

    Regards

    Thread Starter johnmandarine

    (@johnmandarine)

    Hello,

    I tested your code (I’m not very goog at coding) and it’s a little bit strange, because now I have https: two times as you can see on screenshot

    https://www.alpsoft.ch/screenshot01.png

    Plugin Contributor Edson Galina Fortes

    (@glx77)

    Hi,
    it’s strange. Can you try this code :
    add_filter( ‘weglot_href_lang’, $render );
    to modify the hreflang we generate. For exemple you can do :
    add_filter( ‘weglot_href_lang’, ‘weglot_href_lang_custom’ );
    function weglot_href_lang_custom( $render ) {
    $render = str_replace(‘//www.reed-blake.ch’, ‘https://www.reed-blake.ch’, $render);
    return $render;
    }


    if it’s not work, don’t hesitate to reach your issue at [email protected] to share me your website access and I can take a look.

    Regards

    Thread Starter johnmandarine

    (@johnmandarine)

    Hello,

    I wrote you on [email protected]

    Plugin Contributor Edson Galina Fortes

    (@glx77)

    Hi @johnmandarine,

    hope you’re fine ? the issue seems to be fix and due to an issue with wp-rocket. Don’t hesitate to keep me in touch if you need more help.

    Regards

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Incorrect hreflang’ is closed to new replies.