4 min read

Export WooCommerce Coupons to Google Sheets

Coupon rules are difficult to review one edit screen at a time. A Sheet can make codes, discount types, limits, expiry dates, product restrictions, category restrictions, and allowed emails visible in one table.

Shirely 1.3 uses WooCommerce-native coupon import and export. The exporter reads coupon meaning through WooCommerce's coupon object, and the matching importer writes through WooCommerce rather than treating the coupon as a generic post with arbitrary metadata.

Connect the destination Sheet

Every Google Sheets export requires a Google Service Account. In Google Cloud, prepare the credential used by Shirely, then share the destination Sheet with the Service Account email as Editor.

Store the credential file carefully. A public published Sheet can be an unauthenticated import source, but it is not a destination for Shirely exports. Coupon codes and restrictions may be commercially sensitive, so a private Sheet is the sensible default.

Run the export when you are ready to inspect and secure the result. Coupon export is a deliberate store-data job, not one of the scheduled catalog export-slot types in Shirely 1.3.

What the native coupon export contains

The CSV or Sheet begins with:

ID, post_title, post_status, post_excerpt

It then includes the native coupon properties:

meta_discount_type, meta_coupon_amount, meta_individual_use,
meta_usage_limit, meta_usage_limit_per_user, meta_limit_usage_to_x_items,
meta_free_shipping, meta_date_expires, meta_minimum_amount,
meta_maximum_amount, meta_exclude_sale_items, meta_product_ids,
meta_exclude_product_ids, meta_product_categories,
meta_exclude_product_categories, meta_customer_email

The exporter deliberately omits usage history such as usage counts and the list of customers who used a coupon. Those events belong to the store where they occurred.

Expiry is written as a readable date. Empty limits remain empty. Boolean values use readable yes/no values.

Product and category restrictions are portable

Local WordPress IDs do not travel safely between stores. The native exporter therefore represents product restrictions through SKU and category restrictions through slugs. That makes the Sheet more useful for a reviewed cross-store round trip.

Before importing elsewhere, confirm that every product SKU and category slug identifies the intended destination object. A portable token is safer than a local ID, but it can still be missing or ambiguous.

Email restrictions are exported as a list. Treat them as personal and commercial data; restrict access to the Sheet and remove copies that are no longer needed.

Review the Sheet without changing the store

Editing the Sheet does not update WooCommerce in real time. Export and import are separate jobs.

Use filters to inspect:

  • coupon status and code formatting;
  • discount type and amount together;
  • expiry dates;
  • minimum and maximum spend;
  • individual-use and free-shipping flags;
  • usage limits;
  • included and excluded product SKUs;
  • included and excluded category slugs;
  • allowed customer emails.

Keep an unchanged export as a reference. Work from a copy when the team is preparing edits.

Import through the native coupon workflow

The 1.3 importer identifies an existing coupon by its code, using WooCommerce's normalized lookup. A local coupon ID alone is not accepted as proof that a row belongs to that coupon when the code is missing.

This matters between stores: the same numeric ID may belong to unrelated content. Preserve the code and preview a small sample before a wider import.

Coupon updates are partial by design. Keep a change file narrow when only an expiry or limit should change, and verify the saved coupon in WooCommerce afterward.

Test the business rule, not only the fields

On staging:

  1. Export a few low-risk coupons to the private Sheet.
  2. Keep one unchanged, adjust one simple value, and prepare one new coupon.
  3. Import through the native coupon path.
  4. Open every coupon in WooCommerce.
  5. Test an eligible and ineligible cart.
  6. Check expiry, limits, product/category restrictions, and email restrictions.
  7. Confirm result counts and warnings.

A correctly populated edit screen is useful, but the cart test proves how WooCommerce interprets the combined rules.

No live campaign automation

Shirely does not watch coupon cells or push each edit into WooCommerce. Coupon imports and exports remain deliberate jobs. Scheduled Automation exports are limited to supported catalog data, so coupon campaigns should keep their own approval and execution step.

That boundary prevents a spreadsheet edit from silently changing a live promotion. It also means the operator must record which reviewed Sheet and import run created the final rules.

For Service Account setup and the wider data scope, read the WooCommerce Google Sheets hub and the Shirely documentation.