Back to Docs

How to Create and Automate Keys via Generator Rules

WC Serial Numbers premium version comes with a cool feature called Generator Rule which works as a Key source for generating keys automatically based on rules for your products.

First, you have to go to the Tools feature of Serial Numbers and you’ll see a tab called Generators. From there, you’ll click on Add and that will take you to the Add New Generator page.

Now, set your custom key patterns, select the products, select either random or sequential type for your generator, and set valid days (expiry date) and activation limit on if your product requires activation or software functionalities.

Save it and now you have successfully created a generator that will automate the creation of keys.

You can add something like Serial-###### (The sequential type will replace the # with sequential numbers and the random type will replace the # with random alphanumerics. You also have the option to add the yearmonth, and date with your generation rule by adding {Y}, {m}, and {d}.

To use this Generator, you now have to go to the product details section and head over to the product data tab labeled Serial Numbers.

There, you’ll find a Key source option where you’ll see 3 sources.

  • Manually added
  • Generator rule
  • Auto generated key

Select the Generator rule as a key source and a Generator id option will pop out automatically. From there you have to select the generator you created and save it.

That’s it! You’re now good to go.

Please note that you can create multiple generator rules for one particular product but you cannot use all of them at once. You have to select and use only one generator for your particular product at a time.

Besides, the Generator rule will give you the option to pre-generate any number of keys with just one click. If you plan to export the generated keys with other data for further usage then this will be an excellent feature for you.

Please do not forget to enable the checkbox before saving the settings for your products!