• Resolved iamratneshrs

    (@iamratneshrs)


    My Support UIID is

    ampwp-921eff3b-1210-570d-a350-078cb6575c2a

    I want to disable AMP for Desktop users. Please guide

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Milind More

    (@milindmore22)

    Hello @iamratneshrs

    Your site will always be served as non-AMP for desktop users, If you have chosen the setting to redirect mobile users to AMP pages it will redirect mobile visitors to the AMP page. You can disable it from the setting to prevent that.

    I hope this helps!

    Thread Starter iamratneshrs

    (@iamratneshrs)

    No, I mean if Desktop users type: https://www.networkherald.com/?amp on Chrome PC URL, they’ll get to the AMP version, which I don’t want especially for Desktop users. Please guide

    Hi @iamratneshrs,

    Just for curiosity, are your Desktop users going to the AMP version or do you just want to avoid it?

    There is a solution but It could be affected by the cache plugin, make sure to test in a staging environment first and clear the cache when the code is applied as plugin or in a functions.php from your theme:

    
    add_action( 'template_redirect', static function () {
    	if (
    		function_exists( 'amp_is_request' )
    		&&
    		amp_is_request()
    		&&
    		! wp_is_mobile()
    		&&
    		wp_safe_redirect( amp_remove_paired_endpoint( amp_get_current_url() ) )
    	) {
    		exit;
    	}
    } );
    Plugin Support Milind More

    (@milindmore22)

    @iamratneshrs
    As we didn’t receive a response I’ll mark this as resolved. Feel free to open a new support topic if you require any further assistance.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Disable AMP for desktop users’ is closed to new replies.