[ad_1]
Hello @cepkolik
Thank you for contacting us, AMP plugin will convert all links on the AMP page to AMP links to maintain consistency, but in case a link to a non-AMP page is added to the AMP page the link will redirect non-AMP pages.
You can however add an exception to a particular link by adding rel="noamphtml" attribute to the link.
eg:<a href="https://www.cepkolik.com/cep-telefonu/xiaomi-mi-11-ultra/" rel="noamphtml">Xiaomi Mi 11 Ultra</a>
OR use amp_to_amp_excluded_urls filter to add excluded URL’s
eg:
add_filter( 'amp_to_amp_excluded_urls', function( $excluded_urls ) ) {
$excluded_urls[] = 'https://www.cepkolik.com/cep-telefonu/xiaomi-mi-11-ultra/';
});
You can also completely disable amp to amp linking using amp_to_amp_linking_enabled filter.
eg:add_filter( 'amp_to_amp_linking_enabled', '__return_false' );
I hope this helps!
I used this filter (last one) but it kept adding ?amp=1 to the end of the urls automatically.
I added the code below to my function.php file.
add_filter( ‘amp_to_amp_linking_enabled’, ‘__return_false’ );
Also.
All of my pages that I don’t want to put at the end start with “https://www.cepkolik.com/cep-telefonu/”
Hello @cepkolik
Thank you for getting back to us, it seems you are using the NewsPaper theme which uses a plugin for AMP compatibility and it may not be following functions.php while on AMP mode.
Please add the code to a custom plugin
OR
Create a plugin using the below code in your /wp-content/plugins/ directory
create filename disable-amp-to-amp-linking.php copy and paste the code below:
<?php
/**
* Plugin Name: Disable AMP to AMP Linking.
* Plugin URI:
* Description: Disables AMP linking.
* Version: 1.0
* Requires PHP: 7.4
* Author: AMP Support
* Author URI:
* License: GPL v2 or later
* License URI:
*/
add_filter( 'amp_to_amp_linking_enabled', '__return_false' );
Once files are added go to Dashboard->Plugins and Activate the plugin “Disable AMP to AMP Linking”
- This reply was modified 2 hours, 32 minutes ago by Milind More.
