AMP – Change rel="canonical" from functions.php

the source action in

/amp/includes/amp-post-template-actions.php
is:

add_action( 'amp_post_template_head', 'amp_post_template_add_canonical' );
function amp_post_template_add_canonical( $amp_template ) {
?>

<link rel="canonical" href="<?php echo esc_url( $amp_template->get( 'canonical_url' ) ); ?>" />

<?php
}

How I can edit rel from functions.php without editing main file? thanks.

Read more here: AMP – Change rel="canonical" from functions.php

Leave a Reply

Your email address will not be published. Required fields are marked *