1

Put Nofollow on paginate_links

  • Done

Avatar
Alvaro

I need to put nofollow on paginate_links on all product pages.

A

Activity Newest / Oldest

Avatar

Jack Richardson

Status changed to: Done

Avatar

Jack Richardson

Hello @Alvaro

Thank you for sharing your idea with us.
As you know, we prioritize requests based on the number of votes they receive. Therefore, we must wait to see if this request is needed to be implemented.
Thank you for understanding our policy.

P.S. You can read the origin WordPress function that is used by WooCommerce later -> developer.wordpress.org/reference/functions/paginate_links/

As a snippet you can try to add next custom php code to your child-theme/functions.php (prnt.sc/82giciTIwazg)

add_action( 'woocommerce_before_template_part', function($template_name) {
if (basename($template_name) == 'pagination.php') {
add_filter('paginate_links_output', 'etheme_child_filter_wc_pagination_link');
}
}, 10, 1);

add_action( 'woocommerce_after_template_part', function($template_name) {
if (basename($template_name) == 'pagination.php') {
remove_filter('paginate_links_output', 'etheme_child_filter_wc_pagination_link');
}
}, 10, 1);

function etheme_child_filter_wc_pagination_link($links) {
return str_replace( 'href="', 'rel="nofollow" href="', $links );
}

Result -> prnt.sc/ozru06Ag3O_F

Kind regards, Jack Richardson