• Resolved Aashish Pahwa

    (@feedough)


    Dear Team

    I use infinite scroll on archives on my Generatepress powered website.

    While the infinite scroll works like a charm on “?s=” search queries, the wordpress websites also show search result when someone uses the url mywebsite.com/search/search-query

    Now, these archives don’t use infinite scroll or have button to load more when someone uses the paginated version – let’s say mywebsite.com/search/search-query/page/26/amp/ – even when we select the option of infinite scroll in the settings. As a result, many of such pages are appearing on the search engine console as “Excluded by ‘noindex’ tag”.
    While not a major problem, but can you help me with a solution?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Aashish Pahwa

    (@feedough)

    The website is feedough .com.

    Plugin Support Milind More

    (@milindmore22)

    Hello @feedough

    Thank you for the support topic, most infinite scroll mechanisms are based on custom javascript, The AMP does not allow custom javascript on AMP pages so the AMP plugin removes them for you to create a valid AMP page.

    Instead of javascript, the AMP recommend using AMP component amp-next-page for infinite scrolling experinace.

    You can learn more about it in the video below :

    We have created a mini plugin amp-infinite-scroll based on amp-next-page component, please download and install it.

    Also, add the code snippet below in the theme’s functions.php or in a custom plugin.

    
    add_filter(
    	'amp_infinite_scroll_configs',
    	function( $config ) {
    		$cofig = array(
    			'footer'         => array( 'site-footer' => 'div' ),
    			'next_page_hide' => array( 
    				'mobile-header-navigation' => 'nav',
    				'sub-menu-right'           => 'nav',
    				'paging-navigation'        => 'nav',
    			),
    		);
    		return $config;
    	}
    );
    

    The plugin will convert all your archive pages into an infinite scrolling pages

    JFI: We don’t know your exact site layout so this may take longer.

    Plugin Support Milind More

    (@milindmore22)

    Hello @feedough
    Sorry, I just realized there was a small mistake in my previous code snippet

    Instead $cofig it should be $config please use this code snippet instead.

    
    add_filter(
    	'amp_infinite_scroll_configs',
    	function( $config ) {
    		$config = array(
    			'footer'         => array( 'site-footer' => 'div' ),
    			'next_page_hide' => array( 
    				'mobile-header-navigation' => 'nav',
    				'sub-menu-right'           => 'nav',
    				'paging-navigation'        => 'nav',
    			),
    		);
    		return $config;
    	}
    );
    

    @feedough Checking in here –?did the snippet above fix your issue?

    @feedough As we haven’t received a response, I’ll mark this as resolved. Feel free to open a new support topic if you continue to encounter issues, or reopen this topic and we’d be happy to assist. Thank you!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Amp search result pagination problem’ is closed to new replies.