25th Anniversary Savings | 25% Off Dedicated Servers*Shop Now
25th Anniversary Savings | 25% Off VPS Hosting* †††Shop Now
Limited Inventory: High-Performance AMD-Powered Servers Now Available.* Shop Now >
Dedicated Hosting Deals | From $99/moShop Now
Earn hosting credits and a chance to win an Amazon gift card when you refer friends to Liquid Web!Read our promo rules

Create a direct ‘Add to Cart’ link for Products in WooCommerce

Posted on by Dan Pock | Updated:
Reading Time: < 1 minute

If you run a blog and a store all on the same WordPress instance, chances are you are going to talk about products you sell in your blog posts. So, how can you make it easy for your visitors to add products you blog about directly to their cart? You can create a URL that you can use in your posts.

How can I create custom direct ‘Add to Cart’ links for products on my store?

To do this you need the product ID of the item you need an Add to Cart link created for.  You can find the ID for your products from the Products page of your WooCommerce web store. You can see the product ID listed here when you hover your mouse on the products row.

product ID

You’ll then need to create an url like the following: https://www.yourwebsite.com/?add-to-cart=123; where 123 is your product ID, keep in mind you’ll also need to use your domain name.

The most important part of this functionality is that you’re adding the following query parameter to the URL: ?add-to-cart=123

Once you’ve got the link created you can use this on any of your websites pages! In fact, these links can work from anywhere, even places not on your website. So, for example, you could create the link directly to your cart and share these to your partners and affiliates for placing quick item orders!

Avatar for Dan Pock

About the Author: Dan Pock

Dan Pock does technical support at Liquid Web with a background in System Administration, Public Relations, and Customer Service. His favorite things include his cats, Oscar Boots, and Dash Nougat; experimenting with PHP; and making up recipes (or at least attempting to). You can find his coding hijinks on GitHub, where he shares most of his projects and open source work.

Latest Articles

How to Edit the PHP Memory for Your WordPress Site via WP Toolkit

Read Article

What is CGI-Bin and What Does it Do?

Read Article

Top 10 Password Security Standards

Read Article

Top 10 Password Security Standards

Read Article

How to Use the WP Toolkit to Secure and Update WordPress

Read Article