Search Divi Cart Pro Documentation
Search for answers or browse our knowledge base.
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 );