loop url canonical

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

    We apologize for the issue you are facing regarding the canonical URLs in your loop. To set the canonical URL for each page in a loop correctly, you can do this through the Advanced tab in the Rank Math meta box for each post or page. Here’s how you can change the canonical URL:

    1. Edit the Post/Page: Go to the post or page where you want to set the canonical URL.
    2. Find the Rank Math Meta Box: Scroll down to the Rank Math meta box on the edit screen.
    3. Advanced Tab: Click on the Advanced tab within the Rank Math meta box.
    4. Canonical URL Field: In the Canonical URL field, enter the URL that you want Google to consider as the main version of that content.
    5. Update/Publish: After making your changes, make sure to update or publish the post/page.

    Canonical URL Option In Rank Math

    If you have multiple pages generated by a loop and want to ensure they all point to the correct canonical URL, you may need to adjust this setting for each page individually.

    If you’re looking for a more comprehensive setup or if you’re facing technical issues, we recommend considering our professional setup service, which is available for PRO subscribers. You can find more information about this service at Rank Math Services.

    Thank you for raising this concern! If you have any further questions or need assistance, please reply to this ticket, and a human agent will assist you further.

    Sources:
    Alternate Page with Proper Canonical Tag Status in Google Search Console » Rank Math

    temos alguma solução?

    Hello,

    Thank you for your query and we are so sorry about the trouble this must have caused.

    Please try using this filter code to force our canonical to generate self-referencing URL for paginated pages:

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

    You may refer to this guide on how to add filters to your website: https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Let us know how that goes. Looking forward to helping 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 ‘loop url canonical’ is closed to new replies.