If you’re using WordPress and WooCommerce to power your online store, customising “Add to Cart” functionality can greatly enhance the user experience and streamline the checkout flow. As a marketing consultant who specialises in WordPress website and WooCommerce stores, I have found myself ‘googling’ the term “Custom Add to Cart URLs” more times than I can count. It’s a fantastic feature that I frequently use in my own businesses, as well as on my clients’ websites.

That’s why I wanted to share it on the Done Digital blog and provide you with a simple but comprehensive guide to custom add to cart links. I’ll walk you through the exact process of creating your custom WooCommerce links and buttons that you can customise to suit your specific needs and use case cases. Whether you’re dealing with simple products, variable products, or grouped products, these custom links allow you to effortlessly add products to the cart, redirect customers to specific pages, and even set custom quantities—all using simple URLs.

While there are many use cases for custom URLs inn various contexts, in this article, I’ll just focus on custom add-to-cart URLs for your WooCommerce store. So, let’s dive right in!

Where to Find Product IDs in WooCommerce

In order to create your custom URLs, you’ll need the unique product IDs of the products you want to include in the link. Here’s where to easily locate your product IDs in WooCommerce.

How to locate product IDs in WooCommerce to create custom add to cart URLs for your online store - Done Digital

Adding Simple Products to Cart with Custom WooCommerce Links

With simple products, adding them to the cart via a custom URL is a breeze. Here’s how to generate the URLs and specify quantities. Whether you want to redirect customers to the cart, checkout, or any other page, you’ll have full control over the customer journey.

Let’s look at some practical examples:

Custom URL to Add a Simple Product to Cart

This is great if you want to place a simple add-to-cart button or link anywhere on your website:

https://yourwebsite.com/?add-to-cart=25&quantity=1

URL to Add 2 of the Same Simple Products to Cart

You can change the quantity add the end of your URL to control how many items of that same product are added to the cart:

https://yourwebsite.com/?add-to-cart=25&quantity=2

Add a Simple Product to Cart and Send the User Directly to The Cart Page

In some instances, you might want to send the user to the cart page after the product is added. Here’s how to do just that:

https://yourwebsite.com/cart/?add-to-cart=25&quantity=1

Send the User Directly to Checkout After Adding a Simple Product to Cart

This is probably the custom URL I personally use the most. This is great if you want to make sales from a landing page or any other page for that matter. By having users land straight on the checkout page after clicking the “Buy Now” button, you eliminate all friction and increase your conversion rates. Here’s how to build your custom URL:

https://yourwebsite.com/checkout/?add-to-cart=25&quantity=1

Redirect to Any Page After Adding a Simple Product to The Cart

You can further customise the above example and send users to any specific page after adding a product to their cart. This could be to up-sell items, have them register an account or to collect other important information before sending them to checkout.

https://yourwebsite.com/any-page/?add-to-cart=25&quantity=1

The above examples of custom WooCommerce URLs allow for incredible flexibility when it comes to designing your online buying journey and I have personally used them on many of my clients’ websites.

How to Add Variable Products to Cart Using Custom WooCommerce URLs

Variable products may have different variations, but they function in the same way simple products do. What’s important is that you use the correct product ID. In the case of variable products, we will be using the ID of the product variation, rather than the product itself. This allows you to craft custom URLs that add the desired product variation to the cart without having to navigate to the product page.

Just like in the examples above, you can still set quantities and redirect customers to different pages based on your desired outcome and customer journey.

Once again, we’ll use some practical examples that will make it easier to adapt these custom links to your website:

Add One Variable Product to Cart

https://yourwebsite.com/?add-to-cart=88&quantity=1

Add 2 or More of The Same Variable Product to Cart

https://yourwebsite.com/?add-to-cart=88&quantity=2

Change the quantity at the end of the URL to suit your needs.

Add One Variable Product to Cart & Redirect to Cart Page

https://yourwebsite.com/cart/?add-to-cart=88&quantity=1

Add One Variable Product to Cart & Redirect to Checkout Page

https://yourwebsite.com/checkout/?add-to-cart=88&quantity=1

Add One Variable Product to Cart & Redirect to Any Page

https://yourwebsite.com/any-page/?add-to-cart=88&quantity=1

 

If you are using variable products on your websites, these custom URLs can come in handy in streamlining your checkout process and enhancing the user experience. Depending on the WordPress theme you use, the generic product pages can be lacking quite a bit. These custom WooCommerce product links allow you to design your sales page exactly the way you want and send buyers directly to the checkout page.

Adding Grouped Products to Cart Using Custom Add-To-Cart URLs in WooCommerce

Next, let’s look at how to add grouped products to the cart, along with specific quantities for each sub-product. This feature allows you to create custom bundles and offer flexible purchasing options to your customers.

Add a Grouped Product to Cart

To create a custom URL for adding a grouped product to the cart in WooCommerce, you will need to retrieve the Grouped Product ID and the corresponding sub-product IDs. Let’s take an example:

https://yourwebsite.com/?add-to-cart=9876&quantity[5432]=3&quantity[6543]=2

In this scenario, the Grouped Product ID is 9876, and we are adding 3 units of the product with ID 5432 and 2 units of the product with ID 6543.

It’s important to remember that if you wish to add “zero” as the quantity for any of the sub-products, you still need to specify it explicitly. For instance, to add zero units of the product with ID 6543, you would simply use &quantity[6543]=0 in the URL.

Just ensure to replace “yourwebsite.com” with your actual domain name and adjust the product and quantity values based on your specific products and requirements.

And there you have it! By harnessing the power of custom WooCommerce Add to Cart URLs, you can significantly enhance the shopping experience on your WordPress website. Whether you’re a small local business selling a few items online or a large e-commerce store, custom checkout URLs empower you to create seamless customer journeys, increase conversions, and provide a user-friendly buying process that keeps your customers coming back.

What’s your experience with WordPress and WooCommerce? Have you used custom URLs on your website to enhance the checkout flow? Let me know in the comments below!

If you have been wondering how to properly publish blog posts on your WordPress website, you have come to the right place. Publishing content in WordPress is pretty straight forward, however, there are some crucial steps that are often overlooked. We created this simple guide to help you ensure that no important steps are missed, so you can make the most of your content.

The Exact Steps to Publish Blog Posts in WordPress

Whether you are using the classic or Gutenberg editor in WordPress, the steps in this guide will be the same.

Step 1: Log in to your WordPress account

Log in to your WordPress account and navigate to the dashboard.

Step 2: Create a new post

Click on “Posts” on the left sidebar and then select “Add New”. This will open the classic editor.

Step 3: Enter your blog title

At the top of the screen, you’ll see a field marked “Enter title here”. Write your blog post’s title in this field.

Step 4: Write your content

The larger box beneath the title is where you write your blog post.

Tip: If you are pasting content from a different editor, such as Microsoft Word or Google Docs, be sure to remove all formatting before pasting it into the editor, as it can interfere with your website layout.

Formatting of Headings (h1-h3)

The WordPress editor uses what’s called ‘Paragraph’ format for normal text. But you can use Headings to structure your content. It’s essential to use headings correctly to publish blog posts for readability and SEO, but also to make it easier for readers to navigate your content.

The title of your post will automatically be assigned a H1 heading. In the body of your post, you should use H2 for all other main headings, and H3 for subheadings under each H2. You can select these in the editor by highlighting the text and selecting the appropriate heading from the dropdown menu at the top of the editor.

Step 5: Use numbered or unordered lists

Lists are a great way to organise information in your blog posts. Use numbered lists when the order of items is important, like steps in a process. Use unordered lists (bullets) when the order isn’t significant. You can create lists by clicking on the appropriate icons in the editor toolbar.

Step 6: Add a category

Publish blog posts using categories to group your content into different sections or topics. They’re useful for visitors who want to read more of your posts on the same topic. On the right side of the screen, find the “Categories” box and select or create a category that fits your post.

Tip: Only use 1-2 categories per posts.

Step 7: Add tags

Tags are similar to categories but more specific. They help to describe the details of your post and can contain subtopics you are covering. You can add them in the “Tags” box on the right side of the screen.

Tip: Add 10-20 highly relevant keywords that are related to your content as tags to improve SEO.

Step 8: Set a featured image

A featured image represents the contents, mood, or theme of a post or page. Scroll down to the “Featured Image” box on the right side of the screen and click “Set featured image”. Choose an image that suits your post from your library, or upload a new one.

Tip: Remember, when it comes to SEO, image loading speeds matter. That’s why it’s important to keep your images as small in file size as possible (200kb or less). A good image size is 1400px by 800px with a resolution of 72dpi.

Step 9: Preview and publish your post

Before you publish, always preview your post by clicking “Preview” on the right side of the screen. This will show you what your post will look like once it’s live. If everything looks good, hit the “Publish” button.

Other important things to look out for:

  1. Make your content helpful: Always aim to create high-quality content that provides value to your readers. Don’t just write for search engines as this could actually hurt your search rankings.
  2. Use links wisely: Linking to your old posts or other valuable resources on the internet can provide additional value to your readers and can also be good for SEO. Be sure to use a strong anchor text. When linking to an external website, make it open in a new tab, so you don’t lose your readers before they finished reading your post.
  3. Use Blockquotes: If you’re quoting text from another source, use the Blockquote formatting to distinguish it from the rest of your text.
  4. Image Alt Text: Whenever you add images, add ‘alt text’ explaining what the image is about. This helps search engines understand your content better. It’s also used by screen readers for visually impaired users, so make sure it’s relevant.
  5. Call to Action (CTA): If your blog post is trying to achieve something (like sell a product, get subscribers, etc.), don’t forget to add a clear CTA at the end of your post.
  6. Proofread: Make sure to proofread your blog post for grammatical errors, typos, and ensure that it reads smoothly.

If you follow all of the above steps, you will have published your post successfully and for the best possible results.

Need Help Getting Your Website to The Top of Google? Call The SEO Experts at Done Digital

Our Website Care Plans offer incredible value for business owners. Regular WordPress updates, monthly blog posts and a designated SEO expert will ensure your business continues to climb the ranks of Google and co.

Click here to learn more and get started today!