WooCommerce Variable Subscription Add to Cart URL’s

If you are ready to take your WooCommerce website to the next level beyond the standard product page layout, you’re going to need to know how to create a link to put a product into the cart. This comes in hand when creating a custom landing page for a single product and you don’t have WooCommerce template functionality at hand. You might also want to redirect the user once they hit the Add Now button. Here’s a great article with a (semi) comprehensive list of custom URLs for adding products to a WooCommerce cart: https://businessbloomer.com/woocommerce-custom-add-cart-urls-ultimate-guide/

For our purposes, I needed to add a custom URL for our Variable Subscriptions, which the above article didn’t address.

WooCommerce Custom Add to Cart URL for Variable Subscriptions

Product ID

The first step is to locate the product ID, found in the list of products:

Once you have the product ID, start the link with the following href:


Variation ID

The next step is to locate the Variation ID. It’s within the product you want under the variations tab:

We will add &variation_id=idnumber to the end of the url and now looks like this:



The final piece to create the URL is to grab the frequency attribute. Open up the variation you want and find it under Subscription Length:

The final URL will add &atrribute_frequency=Duration to the end of the URL like this:


I hope this helps others out there who need to know how to build out a custom add-to-cart link using WooCommerce Subscriptions. Comment below if you found it useful.


The never+expire attribute didn’t pull the subscription product into the cart. How do you add to cart if you have multiple subscription frequencies for each variable product?


    Hi Anna,

    Do you have AJAX enabled for your cart? I’m not sure that’s the fix, but just wanted to check there first.


Leave a Reply

Your email address will not be published. Required fields are marked *

See if Cinch is right for you.

Ask us anything. Seriously. Like, what is the air speed velocity of an unladen swallow?

Start a chat right now

Or go ahead and Sign up now