Black Friday Super Sale 2024 is Coming Soon

WIN AN iPAD, LIFETIME MEMBERSHIP
×

Search Divi Cart Pro Documentation

Search for answers or browse our knowledge base.

< All Topics
Print

How to remove the ‘nofollow’ from the Add to cart button in Divi Cart Pro?

To remove the ‘nofollow’ from the add-to-cart button in Divi Cart Pro Child theme move to WP admin >> Appearance >> Theme File Editor >> Select the file Divi Cart Pro >> functions.php >> Add the below code

/* filter to remove rel attribute from add to cart button */
function dcp_alter_add_to_cart_button_args( $args, $product ) {
if ( isset( $args['attributes']['rel'] ) ) {
unset( $args['attributes']['rel'] );
}

return $args;
}
add_filter( 'woocommerce_loop_add_to_cart_args', 'dcp_alter_add_to_cart_button_args', 10, 2 );

Was this article helpful?
0 out of 5 stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
5
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.