Skip to content

Instantly share code, notes, and snippets.

@mitchellkrogza
Created September 14, 2021 11:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mitchellkrogza/058d79058a3e9b407db7cc3aa8dd4653 to your computer and use it in GitHub Desktop.
Save mitchellkrogza/058d79058a3e9b407db7cc3aa8dd4653 to your computer and use it in GitHub Desktop.
Woocommerce remove rel="nofollow" from add to cart and select options buttons
/**
* Remove "nofollow" from add to cart / Select options buttons
* What possessed Woocommerce to inplement this we shall never know ?
*/
add_filter( 'woocommerce_loop_add_to_cart_args', 'add_to_cart_args_remove_nofollow' );
function add_to_cart_args_remove_nofollow( $args ) {
unset($args['attributes']['rel']);
return $args;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment