WooCommerce: display “add to wishlist” button on shop page

Remi | August 5, 2014 | in Tips

WooCommerce has an excellent add-on called “WooCommerce Wishlists” that you can get here. This add-on adds an “add to wishlist” button on the product page by default. Here is a quick snippet to add this button on archive pages too (categories pages, main shop page etc…).

Here is the final result:


Place that snippet in functions.php in your theme’s folder.

The author

About the author Remi: Hey! My name is RĂ©mi Corson, i'm a WordPress Expert Developer, i create high level themes and plugins, and i provide free stuff every week on this website!


  1. scott

    Hi, the Add to Wishlist button appears under each product as shown but every add to wishlist button has a link of the current category page I am viewing and is unclickable. Nothing happens when I click on the button. Do you have any suggestions?

    Thank you.

  2. rwlee33

    Hey Remi,
    I’m having the same issue as the others here. It adds the button, but the button doesn’t do anything.

    Additionally, I’d love to have the button NOT redirect to the product after clicking…is this possible?

    The idea being, the users can keep browsing, but quickly add to their wishlist.


  3. rwlee33

    Hey Remi…sorry keep pestering you about this. Do you know why the button displays, but doesn’t function? Thanks in advance for looking into this.


  4. lukeseall@yahoo.co.uk

    I know this is an old thread but…

    The reason the button isn’t clickable is because no wishlists exist. If you create a wishlist first then the button becomes clickable.

    The answer is to edit the woocommerce content-product.php template. Do this by editing the file in your theme rather than the Woocommerce plugin.

    At the top, where the global variables are declared add $wishlists. Separate by a comma.

    Then at the bottom, before the closing tag, add this form code

    <form class="cart" method="post" enctype='multipart/form-data' action=" $product->id), $product->add_to_cart_url() ); ?>”>
    <input type="hidden" name="add-to-cart" value="id ); ?>” />
    add_to_wishlist_button(); ?>

    There might be a neater way of doing this with hooks/filters but this does the job for now.

Leave a reply