• Resolved alexg9

    (@alexg9)


    Hello,

    I’m currently experiencing an error that is causing issues with correctly indexing the URL. Page Speed indicates:

    ‘Document does not have a valid rel=canonical attribute. Points to the root URL of the domain (the home page), rather than to an equivalent content page.’

    I haven’t configured this explicitly, so I suspect it might be a conflict between RankMath and JetEngine Custom Post.


    The tag has been placed by RankMath but It seems like it’s not possible to to modify the canonical tag. Rank Math is encountering difficulties in editing the custom landing page created with Jet Engine.

    https://i.ibb.co/HXMGBG6/rankmath-canonical.png

    • This topic was modified 11 months, 1 week ago by alexg9.

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support Rank Math Support

    (@rankmathsupport)

    Hello @alexg9,

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

    Checking the affected page we can confirm that the Canonical is pointing to the homepage which is incorrect.

    Can you please visit the Rank Math SEO advanced settings on that particular page and check if the canonical is modified? See the screenshot for your reference: https://i.rankmath.com/i/zvtXpg

    If it’s not modified, then there may be a plugin that is causing the change since we haven’t heard any issues with Rank Math and JetEngine with regard to the canonical tags. To determine that, please follow this guide: https://rankmath.com/kb/check-plugin-conflicts/

    Also, if you have trouble changing the canonical URL, please follow this guide as well: https://rankmath.com/kb/meta-data-not-saving/

    Let us know how that goes. Looking forward to helping you.

    Thread Starter alexg9

    (@alexg9)

    It is not possible to access the advanced Rank Math SEO settings on that page.

    As I said, it’s a custom post type created with JetEngine, and that landing page is a template created with Jet Theme Core. So it has no “editable settings”. Because of how jet theme core works, I had to create a template for the landing as an archive page. Everything works perfect, except the canonical tag.

    About adding the canonical tag, the only plugin installed with the ability to add a canonical tag is RankMath. I don’t have any other plugin with that option and I haven’t added it manually. And, if you look the HTML, you can see the canonical tag is being added in the RankMath settings zone.

    If you want I can give you a temporary admin access to check it personally

    • This reply was modified 11 months, 1 week ago by alexg9.
    Plugin Support Rank Math Support

    (@rankmathsupport)

    Hello @alexg9,

    In this case, can you please use the following filter on your website and see if that works for you?
    add_filter( 'rank_math/frontend/canonical', function( $canonical ) { global $wp; $current_slug = home_url( $wp->request ); $canonical = $current_slug; return $canonical; });
    Here’s how you can add filter/hook to your WordPress site:?https://rankmath.com/kb/wordpress-hooks-actions-filters/

    This filter will force Rank Math to generate self-referencing canonicals all over your website.

    Let us know how it goes. Looking forward to helping you.

    Thread Starter alexg9

    (@alexg9)

    Thank you!

    I have adapted the code because I only wanted to use it on that url and it has worked perfectly. Now I’m seeing is necessary to remove the “rel=next” attribute that is pointing to the homepage too.

    Could you check it?

    https://i.ibb.co/xqqYhwL/canonicalnextattibute.png

    Plugin Support Rank Math Support

    (@rankmathsupport)

    Hello @alexg9,

    You can do that by applying this code:

    add_filter( 'rank_math/frontend/disable_adjacent_rel_links', '__return_true' );

    Let us know how that goes. Looking forward to helping you.

    Thread Starter alexg9

    (@alexg9)

    Hi,

    I’ve stopped the experiment because after using the filter to remove the canonical, the URL has passed from position 6 to be de-indexed by Google. How can this be possible?

    Plugin Support Rank Math Support

    (@rankmathsupport)

    Hello @alexg9,

    The page’s canonical is without a trailing slash, which could be why Google has de-indexed it. Please modify the filter and add a trailing slash to the canonical URL. Once done, use the URL inspection tool of your GSC account to request the indexing again, and the issue should be fixed after that.

    Let us know how that goes. Looking forward to your update.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Document does not have a valid rel=canonical’ is closed to new replies.