Back to knowledge base

Can I use product metadata fields to control what WriteText.ai generates?

Tags: custom prompt, metadata, product fields, WooCommerce, conditional content, templates

Yes. WriteText.ai has access to your product metadata fields during generation, which means you can reference field values inside a custom prompt to change what the output contains. This is useful when products in your catalog fall into distinct categories that need different messaging, such as rental versus purchase products, or items with different compliance requirements. 

How to set this up

Write a conditional instruction in your custom prompt that tells WriteText.ai what to do depending on the field value. Make sure the relevant metadata field is selected in the plugin before running generation.

Two approaches

Using a specific phrase

If you want a fixed phrase to appear depending on the field value, include it directly in the instruction:

Example prompts

  • Rental products (field value = yes): "This is a rental product. Include the phrase 'rent this tool' in the meta title."
  • Purchase products (field value = no): "This is a product available for purchase. Include the phrase 'buy this tool' in the meta title."

Using context-aware messaging

If you want the AI to adjust its tone and framing based on the field value rather than inserting a specific phrase:

Example prompts

  • Rental products: "If [field name] = yes, this product is available for rent. Write the meta title to reflect that the customer will be renting, not buying."
  • Purchase products: "If [field name] = no, this product is available for purchase. Write the meta title accordingly."

The specific phrase approach gives you more control over exact wording. The context-aware approach gives the AI more flexibility to produce natural-sounding output. 

For a full overview of how custom prompts work, see how custom prompts and special instructions work.  

 

CONTENTS