• Resolved Jayme Edwards

    (@jcedwards76)


    I’ve created an amp-first theme and I’m using the AMP for WordPress plugin so any content rendered goes through it (gutenberg etc.).

    I have many links in my theme to external sites that I’ve put rel=”external noopener” in the PHP, but it seems they are being stripped out.

    Any idea if this is the WordPress for AMP plugin or something else? Other than prettylinks and yoast, it’s pretty much a vanilla installation.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Weston Ruter

    (@westonruter)

    I just tried adding a post with this content:

    <p>External <a rel="external noopener" href="https://example.com">link</a>.</p>

    The rel persists in AMP. I just checked in all three modes (Standard, Transitional, and Reader) and the rel remains.

    Thread Starter Jayme Edwards

    (@jcedwards76)

    Hey Weston,

    Thanks for getting back to me so quickly.

    I’m not sure you noticed (or I didn’t make it explicit enough in my post) – but this isn’t an issue with content in the editor.

    It’s an issue with themes that render PHP and use AMP.

    For example header.php, page.php, category.php etc. in a typical theme.

    I have my site set to “Standard”, and I’m using the explicit AMP theme hook in functions.php called by the after_setup_theme filter e.g.:

    /**
     * Register that this theme provides AMP for all templates!
     */
    add_theme_support( 'amp', array(
      'templates_supported' => 'all'
    ));

    Thanks,

    Jayme

    • This reply was modified 4 years, 9 months ago by Jayme Edwards.
    Plugin Author Weston Ruter

    (@westonruter)

    Right, I looked at the frontend, the AMP page being rendered. The rel remained intact in Standard mode.

    What is the PHP code you are using?

    Thread Starter Jayme Edwards

    (@jcedwards76)

    It’s just a link in my footer within the theme:

    <a href="https://youtube.com/JaymeEdwardsMedia" rel="external noopener" target="_blank" draggable="false" title="Healthy Software Developer on YouTube"><i class="fab fa-youtube"></i>YouTube</a>

    When it’s rendered it looks like this:

    <a href="https://youtube.com/JaymeEdwardsMedia" target="_blank" draggable="false" title="Healthy Software Developer on YouTube"><i class="fab fa-youtube"></i>YouTube</a>

    Plugin Author Weston Ruter

    (@westonruter)

    I tried adding it to the footer.php in the Twenty Twenty theme, and in AMP the rel remains intact.

    Thread Starter Jayme Edwards

    (@jcedwards76)

    Thanks for checking man. I’m guessing you kept standard mode on for twenty twenty?

    This is so frustrating. I went one by one disabling plugins and I can add any other attribute to the link but rel and it keeps it.

    Something’s gotta be taking it out!

    Appreciate you looking into it, hrmmmmm…

    Thread Starter Jayme Edwards

    (@jcedwards76)

    AAAAH I found it!

    It’s the “Glue for Yoast SEO & AMP plugin”!

    I’ll have to start on their forums next.

    Thanks again for looking into this!

    Plugin Author Weston Ruter

    (@westonruter)

    Yes, I checked in Standard Mode for Twenty Twenty.

    Plugin Author Weston Ruter

    (@westonruter)

    The Yoast Glue plugin should no longer be needed. Yoast is fully AMP-compatible in Standard mode.

    Thread Starter Jayme Edwards

    (@jcedwards76)

    Thanks Weston! That definitely did the trick.

    ??

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘rel being stripped from theme pages’ is closed to new replies.