Join the Soledad Facebook Users Group here
for Share, assistance, discussion, and Updates related to Soledad WordPress Theme.

If you can't create a new ticket - you can send us an email via our contact form and we will get back to you.

Okay
  Public Ticket #1927434
AMP
Closed

Comments

  •  1
    OtaXou started the conversation

    Hello,

    I come to you with a problem that a SEO manager friend of mine pointed out on our installation of Soledad.

    The canonical link on any of our AMP pages features a second / after our domain name, making the link fail for some of our readers and degrading our SEO. 

    The problem also exists, on the same pages, with the link for the "Add a comment" button which also features this //. You can easily see the problem for yourself searching ".fr//" on the source code of any AMP pages on our website.

    How could I fix this problem please ?

    Thank you very much for your help !

  •  2,699
    PenciDesign replied

    Hi,

    As I can see your AMP page working fine:

    https://legrandpop.fr/amp/test-ape-out-nintendo-switch-pc.html

    So, can you tell me more detail about what's your problems?

    The /amp/ display after your domain will make google can detect your amp pages and load it when someone access to AMP. It doesn't affect anything with your SEO.


    Best Regards,

    PenciDesign

  •  1
    OtaXou replied

    Hi there, thanks for this first response.

    My problem is not that the AMP pages aren't working.

    It is, as I was saying on my first message, that in the source code of my AMP pages, the "link rel=canonical" attributes within the head meta have a link with a "//" after the domain name. That same error, the "//", also appears on the link of the "Add comment" button. 

    Please look at the images attached to my first post that highlight this fact.

  •  2,699
    PenciDesign replied

    Hi,

    Ahh, I understand it now.

    Please send me your admin url and admin account ( username and password ) - in a private reply. I will take it a look on this help you.


    Best Regards,

    PenciDesign

  •  1
    OtaXou replied

    I am NOT going to give you the admin access of my website, even in a private message. This is not an acceptable request from a customer service.

    Just tell me the steps to follow in order to fix it and I'll do it. Thank you. 

  •  2,699
    PenciDesign replied

    Hi,

    Ok, if so please try open plugins\penci-soledad-amp\includes\sanitizers\class-amp-link-sanitizer.php file on your hosting and on line 126 with this code:

    public static function __pre_url_off( $link ) {
            if( false !== strpos( $link, PENCI_STARTPOINT ) ){
                $start_point = '/' . PENCI_STARTPOINT;
                $link = str_replace( $start_point, '', $link  );
            }
            return $link;
        }
    

    remove    /    on the above code and try it again.


    Best Regards,

    PenciDesign

  •  1
    OtaXou replied

    Well, problem solved ! Not exactly as we expected though, but solved anyway.

    My version of plugins\penci-soledad-amp\includes\sanitizers\class-amp-link-sanitizer.php had a function different than yours, like this :

    public static function __pre_url_off( $link ) {

    if( false !== strpos( $link, PENCI_STARTPOINT ) ){
    $start_point = PENCI_STARTPOINT;
    $get_last = substr($link, -1);
    if( '/' == $get_last ){
    $start_point = PENCI_STARTPOINT . '/';
    }

    $link = str_replace( $start_point, '', $link  );
    }

    return $link;
    }


    I just replaced the whole function with the code you gave me, without changing a thing, and it is now working properly.

    Thank you for your help.