-
Hi there,
I am currently using the discontinued Better Amp Plugin for AMP. Someday I will upgrade but for now i’ve customized it to work for me.
The only issue is Rank SEO has some code left for Better AMP /includes/frontend/class-head.php
Line 45 –
remove_action( ‘better-amp/template/head’, ‘better_amp_print_rel_canonical’ );This removed the Canonical URL created by Better AMP.
Line 147 –
if ( Helper::is_amp_active() ) {
Does NOT detect an AMP pageLine 216
– echo ‘<link rel=”canonical” href=”‘ . esc_url( $canonical, null, ‘other’ ) . ‘” />’ . “\n”;Shows the incorrect URL on all amp pages –
<link rel=”canonical” href=”https://www.domain.com/blogpost/amp/”> ( with incorrect /amp/ at end )I can manually comment line 46 and 216 out and better amp will display correct url <link rel=”canonical” href=”https://www.domain.com/blogpost/”> once again, but obviously this breaks with every update.
Can you please offer a suggestion for a permanent fix?
The ticket ‘Showing incorrect canonical URL with better amp Plugin’ is closed to new replies.