• HolaEffect

    (@holaeffect)


    Hey,

    Some of our pages were not indexing as AMP pages, because the <link rel=”amphtml”…> was shown too far down in the HTML.

    I then did this:

    add_action( 'wp_head', 'mm_remove_action', 1 );
    function mm_remove_action(){
      remove_action( 'wp_head', 'amp_add_amphtml_link' );
    }
    
    add_action( 'wp_head', 'amp_add_amphtml_link', 1 );

    However, after adding that to the functions.php, ALL pages, even those with AMP disabled, were having the rel=”amphtml” code added.

    So how can I move the rel=”amphtml” code higher up in the <head> without having it show on all pages?

    • This topic was modified 6 years ago by HolaEffect.
  • The topic ‘How to move “<link rel="amphtml" …" higher up in the head’ is closed to new replies.