elementor loop grid pagination canonical

#661603
  • Resolved Anonymous
    Rank Math free

    Hi guys, I’m not the first that has this issue.

    Elementor loop grid, paginated.
    Every page’s canonical points at page one (example: domain.com/blog/2/ points at domain.com/blog )

    The page is not set as an archive.

    I tried setting it as an archive, resulting in all paginated pages except the first one being a 404.

    I then tried adding the php filter like you suggested to other users, with no luck.

    Need help to solve this issue.

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for any inconvenience this issue may have caused you.

    In this case, please try applying this filter on your site to set a self-referencing canonical on URLs with blog:

    add_filter( 'rank_math/frontend/canonical', function( $canonical ) {
    	$url = 'https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
    	if(strpos($url,'blog') !== false){
    		return $url;
    	}
    	
    	return $canonical;
    });

    And here’s a guide to adding the filter to your website:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Let us know how this goes.

    Thank you.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 1 replies (of 1 total)

The ticket ‘elementor loop grid pagination canonical’ is closed to new replies.