Canonical URL weird for Category Pages

#804328
  • Resolved Anonymous
    Rank Math free

    To give context we migrated from yoast to rankmath which yoast was causing issues with the canonical url’s.

    Please note: We have yoast deactivated at the moment. This issue does not happen when we also deactivate rankmath

    So on our categories pages (blog post categories / post categories) the canonical URL is being injected strange. It gets injected as “domain.com/./category-handle/” so if our category handle is “blog” rankmath injects our canonical url as “domain.com/./blog”

    Note: I know you can override the canonical URL on these category pages, which does work. HOWEVER it adds a rel=”next” item as well that has the WRONG canonical URL.

    Here is the code snippet that rankmath injects into our header:

    *I have changed the domain to domain.local manually in the code segments below

    
    <link rel="canonical" href="https://domain.local/blog">
    <link rel="next" href="https://domain.local/./blog/page/2/">
    

    you can see the first link is fine, the second one (that rankmath is injecting) is incorrect.
    How can we resolve this?

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

    Thank you for reaching out about the issue you are facing with the canonical URL on your category pages after migrating from Yoast to Rank Math. I understand that Rank Math is injecting the canonical URL in a strange format, causing an issue with the rel=”next” item as well.

    To address this problem, you can follow these steps:

    1. Override Canonical URL: As you mentioned, you can manually override the canonical URL on the category pages. However, this may not solve the issue with the rel=”next” item.

    2. Contact Rank Math Support: Since this seems to be a specific issue related to how Rank Math handles canonical URLs on category pages, I recommend reaching out to Rank Math Support directly for further assistance. You can contact them here.

    If you provide them with the details you shared here, including the code snippet and the specific behavior you are experiencing, they should be able to investigate and provide you with a solution tailored to your situation.

    If you have any more questions or need further assistance, please feel free to let us know. We’re here to help!

    Sources:
    Alternate Page with Proper Canonical Tag Status in Google Search Console » Rank Math
    Setting Canonical URLs in Rank Math » Rank Math
    How to Fix “Duplicate, Google Chose Different Canonical than User” » Rank Math
    How to Fix ‘Duplicate Without User-Selected Canonical’ Status in Google Search Console » Rank Math

    Hello,

    Thank you for contacting Rank Math support.

    To help you investigate this issue, we might need to take a closer look at your website and settings. Please follow these steps:

    • Edit the first post on this ticket and include your WordPress logins in the Sensitive Data section. This is a secure section that only our support staff can access.
      Sensitive Data Section
    • Make sure you take a complete backup of your website before sharing the information with us.
    • If you prefer, you can use this plugin to generate a temporary login URL to your website and share that with us instead: https://wordpress.org/plugins/temporary-login-without-password/
    • You can also use this plugin to monitor what changes our staff might make on your website (if any): https://wordpress.org/plugins/wp-security-audit-log/

    We appreciate your cooperation and patience. Thank you for choosing Rank Math.

    Anonymous
    Rank Math free

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Hello,

    The strange URL you were seeing was because a dot (.) was added in the Category base option in your site’s Permalinks settings:
    https://imgur.com/kGC806r

    We removed it and saved changes and now that category base is no longer part of your URL. We also removed the custom canonical URL you added so that Rank Math can automatically generate a self-referencing canonical URL for that page.

    As regards the rel=next tag, please use the following filter to remove the tag:

    add_filter( 'rank_math/frontend/disable_adjacent_rel_links', '__return_true' );
    Here is how to add a filter to your site: https://rankmath.com/kb/wordpress-hooks-actions-filters/

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

    Hope this helps. Let us know if you need any other assistance.

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

The ticket ‘Canonical URL weird for Category Pages’ is closed to new replies.