Blog Post Pagination Pages Canonicals

#776465
  • Resolved Moataz Abdel Badiee
    Rank Math free

    I’m facing a problem with blog pages on my website I try to create a unique canonical page for each blog separately
    Example: blog/3/canonicalized to the same page blog/3/
    how could I do that

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

    I’m sorry to hear about the issue you’re facing with setting up unique canonical URLs for your blog pages. To create a unique canonical URL for each blog post, you can follow these steps using Rank Math:

    1. Edit the Blog Post: Open the specific blog post you want to set a unique canonical URL for by clicking on the Edit option.

    2. Navigate to the Advanced Tab: Once you’ve opened the blog post, navigate to the Advanced tab of Rank Math in your editor. If you can’t find the Advanced tab, please enable the advanced mode from your WordPress Dashboard → Rank Math SEO → Dashboard.

    3. Set the Canonical URL: In the Canonical URL field under the Advanced tab, enter the unique canonical URL you want Google to index for that specific blog post.

    Here is a reference screenshot of where you can set the Canonical URL in Rank Math:

    Add the canonical URL

    1. Save the Changes: Once you’ve entered the unique canonical URL, save your changes by updating the blog post as you normally would.

    By setting a unique canonical URL for each blog post using Rank Math, you can ensure that Google indexes the correct version of each blog post separately.

    If you need further assistance or have any more questions, please feel free to reach out to our support team here. We are here to help you with any additional queries you may have.

    I hope this helps resolve your issue with setting up unique canonical URLs for your blog pages. Thank you for reaching out to us!

    Warm regards.

    Sources:
    How to Fix “Duplicate, Google Chose Different Canonical than User” » Rank Math
    Advanced Tab in Rank Math SEO’s Meta Box
    Setting Canonical URLs in Rank Math » Rank Math
    Setting Canonical URLs in Rank Math » Rank Math
    Why Did My Website Disappear From Google Search? » Rank Math

    This is not what I meant

    How could I make all the pagination pages with unique URL not all referring ti the same blog page URL

    Hello,

    Thank you for contacting Rank Math support.

    Please use the following filter to set the self-referencing canonical of the paginated pages:

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

    Here is how to add a filter to your site: https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Hello Jaideep

    It’s still not working after I add the coder snippets

    Hello,

    Can you please share a couple of pagination page URLs here so we can take a closer look?

    Looking forward to helping you.

    It’s just usual pagination pages like
    https://example.com/blog/
    https://example.com/blog/2/

    Hello,

    Thank you for your patience.

    The paginated pages should also return true for the is_paged() function of WordPress, but it seems they don’t on your site, and that’s why there are no adjacent links even on the main page.

    In this case, you may try this filter instead to apply the self-referencing canonical:

    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;
    });

    If the issue persists, then please share the actual URL so we can as well.

    Let us know how this goes.

    Thanks, it works now

    Hello,

    We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.

    If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post or TrustPilot about your overall experience with Rank Math? We appreciate your time and patience.

    If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.

    Thank you.

Viewing 10 replies - 1 through 10 (of 10 total)

The ticket ‘Blog Post Pagination Pages Canonicals’ is closed to new replies.