Canonical rong and double

#138669
  • Hi, can someone please help with my canonical URL, please?
    Rank Math uses the wrong link rel= canonical on almost all main pages. As well I see I have 2 canonical on the same page.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello,

    Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.

    It seems the plugin your using for your listings is already adding a canonical URL to your pages. As this seems to be correct, please add the following to your theme functions.php to remove Rank math canonical:

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

    Let us know if this helps you. Thank you.

    ​​​​​​​

    Perfect.Thanks

    Hello,

    I am happy it helped you. Let me know if it works on your end or do you have any other questions?

    We are looking forward to helping 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 3 replies - 1 through 3 (of 3 total)

The ticket ‘Canonical rong and double’ is closed to new replies.