How to do? disable canonical URLs for single.php pagination

#183815
Viewing 7 replies - 1 through 7 (of 7 total)
  • Wrong:
    <link rel=”canonical” href=”https://sitename.com/topic-one-url” />
    fixed:
    <link rel=”canonical” href=”https://sitename.com/topic-one-url/>

    Hi.
    I want to disable canonical URLs for single.php pagination.

    https://sitename.com/topic-one-url
    (the canonical URL is displayed)
    <link rel=”canonical” href=”https://sitename.com/topic-one-url />

    https://sitename.com/topic-one-url/2
    ( canonical URL show the same .. )
    <link rel=”canonical” href=”https://sitename.com/topic-one-url />

    Hello,

    Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for the delay.

    To remove the canonical URL of your paginated pages, you can enable this option in Rank Math > Titles & Meta > Misc Pages
    Noindex Paginated

    Please note that some options are only available when you enable the Advanced Mode in Rank Math. If it’s not showing, you must have chosen to use the Easy Mode. Please follow the steps in this link to switch to Advanced Mode:
    https://rankmath.com/kb/advanced-mode/

    I hope that helps. Thank you, and please don’t hesitate to contact us anytime if you need further assistance with anything else.

    Thank you for reply.
    I do NOT want to remove canonical URLs of my paginated pages.

    I want to show the same canonical URLs on “single.php pagination pages”.

    🙁

    Brian
    Rank Math free

    Hello,

    Thank you for contacting Rank Math again.

    Rank Math automatically adds a self canonical tag to your pages. To change this within your dynamically generated paginated pages on your site, you can customize the following filter to use the current URL as the canonical:

    /**
     * Allow changing of the canonical URL.
     *
     * @param string $canonical The canonical URL.
     */
    add_filter( 'rank_math/frontend/canonical', function( $canonical ) {
    	return $canonical;
    });

    Hope this is helpful. Let us know if you have any other questions.
    Thank you.

    I asked for help because I couldn’t do it. I do not know how to do it.
    I think I’ll stop using the plugin.

    Hello,

    You would need to know about coding since it is an advanced filter (or hire a freelancer to do it for you).

    Meanwhile, we can’t provide custom code (due to being a small team), if you (or a freelancer you hire) have questions about particular things in the code, we will be more than happy to help you.

    However, we respect your decision if you have already decided to discontinue using Rank Math.

    Please don’t hesitate to contact us anytime if you need further assistance with anything else.

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

The ticket ‘How to do? disable canonical URLs for single.php pagination’ is closed to new replies.