• Resolved leralk

    (@leralk)


    Hello,

    I want to inlcude a link to non-AMP version of the page for the users. How can I do it?

    It looks like every internal link on the site gets “?amp” parameter regardless of what I’m doing.

    Thank you

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • @leralk For any links within an AMP URL you can apply the rel=noamphtml attribute for a link to the non AMP version. To ensure the link only appears on AMP URLs you can use is_amp_endpoint as below:

    <?php if ( function_exists( ‘is_amp_endpoint’ ) && is_amp_endpoint() ) : ?>
    <a href="https://example.com" rel="noamphtml">To non-AMP</a>
    <?php endif; ?>

    You can disable AMP to AMP linking overall using the below filter:

    add_filter( 'amp_to_amp_linking_enabled', '__return_false' );

    You’ll find out more on the above, along with an exclude URL filter below:
    https://github.com/ampproject/amp-wp/pull/4146

    Super, thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Non-AMP link’ is closed to new replies.