How create Canonical to first pagination page in WooCoomerce categories?

#356745
Viewing 3 replies - 1 through 3 (of 3 total)
  • Azib Yaqoob
    Rank Math business

    Hello,

    Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.

    You need to add this filter code to your functions.php file. We recommend this method to add filters and hooks, please follow this guide:
    https://rankmath.com/kb/filters-hooks-api-developer/#num-1-create-rank-math-php-file

    We hope that helps. Please don’t hesitate to contact us again if you need further assistance.

    Thank you

    ​​​​​​​

    Hello,
    I tried to add the code to the functions.php file, I still don’t see the canonical tag on the second page of the woocommerce product category page

    add_filter( ‘rank_math/frontend/canonical’, function( $canonical ) {
    if ( is_tax( ‘product_cat’ ) && is_paged() ) {
    $object = get_queried_object();
    return get_term_link( $object->term_id );
    }
    return $canonical;
    });

    Hello,

    Can you please clear your website and browser cache and try checking again?

    If the issue persists, please share the affected URL with us so we can further check it from our end. Also, we might need to take a closer look at the settings. Please edit the first post on this ticket and include your WordPress login in the designated Sensitive Data section.

    Please do take a complete backup of your website before sharing the information with us.
    Sensitive Data Section

    It is completely secure and only our support staff has access to that section. If you want, you can use the below 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 use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):

    https://wordpress.org/plugins/wp-security-audit-log/

    We really look forward to helping 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 3 replies - 1 through 3 (of 3 total)

The ticket ‘How create Canonical to first pagination page in WooCoomerce categories?’ is closed to new replies.