How to make canonical in pagination

#206466
  • Resolved Rama Angriawan
    Rank Math free

    I want to paginate my homepage using canonical links. For now I can only set noindex in every pagination

    So pagination exampledomain.com/page/2 canonical to exampledomain.com/

    Can the free version of rankmath set canonical links for pagination?

Viewing 1 replies (of 1 total)
  • Brian
    Rank Math free

    Hello,

    Thank you for getting back to us.

    With Rank Math the implementation of canonical on the paginated pages sets the canonical of the main index page on all paginated pages.

    For example, the page https://yourdomain.com/blog/page/2 would have a canonical of https://yourdomain.com/blog. This is the recommended way of canonical implementation in paginated pages as Google sees them as the same page as the main page.

    However, if you wish to change this, you can customize the following filter to use the current URL as the canonical:

    /**
     * Allow changing of the canonical URL.
     *
     * @param string $canonical The canonical URL.
     */
    add_filter( 'rank_math/frontend/canonical', function( $canonical ) {
    	return $canonical;
    });

    Hope that helps you. 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 ‘How to make canonical in pagination’ is closed to new replies.