changing my category pagination canonical url to category homepage

#848651
  • Resolved sandeep maheshwari
    Rank Math free

    This is the third page of my category page but I want to keep its canonical url on my front page which is of this category how can I do this

    https://i.postimg.cc/KjrTN3hL/Screenshot-2024-08-01-160552.png

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

    We apologize for the issue you are facing with changing the canonical URL for your category pagination. To set the canonical URL of your category pagination pages to point to the category homepage, you can follow these steps:

    1. Enable Advanced Mode in Rank Math if you haven’t already. You can do this by navigating to WordPress Dashboard → Rank Math SEO and enabling it from there.
      Enable Advanced Mode

    2. Edit the Pagination Page: Go to the specific pagination page you want to edit.

    3. Set the Canonical URL: In the Rank Math meta box, find the Advanced tab. Here, you will see a field for the Canonical URL. Enter the URL of your category homepage in this field.
      Canonical URL Field

    4. Update the Page: After entering the canonical URL, make sure to update the page to save your changes.

    By doing this, you will inform search engines that the canonical version of this pagination page is actually your category homepage.

    If you have any further questions or need additional assistance, please feel free to reply to this ticket, and a human agent from our support team will assist you further. Thank you for raising this concern!

    Sources:
    Alternate Page with Proper Canonical Tag Status in Google Search Console » Rank Math
    How to Fix ‘Duplicate Without User-Selected Canonical’ Status in Google Search Console » Rank Math

    Hello,

    To set the canonical to the first page, you can use this filter on your site:

    add_filter( 'rank_math/frontend/canonical', function( $canonical ) {
    	if ( is_paged() ) {
    			$link = $_SERVER['REQUEST_URI'];
    			$arr = explode('/page/', $link,);
    			$canonical = home_url($arr[0]. '/');
    		}
    		return $canonical;
    });

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

    Hope that helps.

    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 2 replies - 1 through 2 (of 2 total)

The ticket ‘changing my category pagination canonical url to category homepage’ is closed to new replies.