AI Product Tools Documentation Logo
AI Product ToolsDocumentation
Advanced Features

Variables & Custom Fields

Master dynamic content generation with variables and custom field integration for personalized product descriptions

Variables and custom fields are powerful features that allow you to create highly personalized and dynamic product descriptions. By mapping your existing product data to prompt variables, you can ensure that AI-generated content includes specific, accurate information about each product.

Key Concepts

Variables

Placeholders in prompts that get replaced with actual product data

Custom Fields

Additional product information stored in WordPress/WooCommerce

Field Mapping

The process of connecting custom fields to prompt variables

Dynamic Content

Content that changes based on individual product data

Benefits

Key Advantages:

  • Personalization: Each product gets unique, relevant content
  • Accuracy: Specific product details are always included
  • Efficiency: Automate inclusion of technical specifications
  • Consistency: Standardized information presentation
  • Scalability: Works across large product catalogs

Understanding Variables

What Are Variables?

Variables are placeholders in your prompt templates that get automatically replaced with actual product information during generation. They use a simple syntax: {variable_name}.

Example Usage

Prompt Template:

Create a product description for \{title\} priced at \{price\}.
This \{category\} product is made from \{custom1\} and offers \{custom2\} benefits.
Keep the description under \{max_length\} characters in \{language\}.

Generated for Specific Product:

Create a product description for Organic Cotton T-Shirt priced at $29.99.
This Clothing product is made from 100% organic cotton and offers hypoallergenic, eco-friendly benefits.
Keep the description under 500 characters in English.

Variable Syntax

Basic Syntax

Syntax Rules:

  • Format: {variable_name}
  • Case Sensitive: {TITLE} is different from {title}
  • No Spaces: Use underscores for multi-word variables
  • Alphanumeric: Letters, numbers, and underscores only

Advanced Syntax (Advanced Mode)

  • Conditional: {custom1|default_value}
  • Formatting: {price|currency}
  • Transformation: {title|uppercase}

Built-in Variables

General Variables

These variables control generation parameters:

Content Control

  • {max_length}: Maximum description length
  • {max_short_length}: Maximum short description length
  • {language}: Target language for generation
  • {style}: Writing style preference

Example Usage

Write a \{style\} product description in \{language\}
with maximum \{max_length\} characters.

Product Variables

These variables contain product-specific information:

Basic Product Data

  • {title}: Product name/title
  • {sku}: Product SKU code
  • {price}: Current product price
  • {regular_price}: Regular price (before discounts)
  • {sale_price}: Sale price (if on sale)

Product Classification

  • {category}: Primary product category
  • {categories}: All product categories (comma-separated)
  • {tags}: Existing product tags
  • {attributes}: Product attributes (size, color, etc.)

Example Product Variables Usage

Product: \{title\} (SKU: \{sku\})
Category: \{category\}
Price: \{price\} (Regular: \{regular_price\})
Features: \{attributes\}

Standard vs Advanced Mode Variables

Standard Mode Variables

Available Variables:

  • All general variables
  • Basic product variables
  • Limited customization options

Advanced Mode Variables

Additional Variables:

  • Extended product data
  • Custom field mappings
  • Third-party plugin integration
  • Advanced formatting options

Custom Variables

Creating Custom Variables (Advanced Mode Only)

Custom variables allow you to map any product field to a prompt variable, enabling highly specific and detailed content generation.

Step-by-Step Creation

1. Access Custom Variables

  1. Navigate to AI Product ToolsSettings
  2. Go to Advanced Bulk Generator section
  3. Click Custom Variables tab
  4. Click Add Custom Variable

2. Configure Variable Mapping

Variable Setup:

  • Variable Name: Choose a descriptive name (e.g., "material")
  • Field Source: Select the custom field to map
  • Variable Code: Automatically generated (e.g., {custom1})

3. Field Selection

Available Field Types:

  • WooCommerce custom fields
  • Advanced Custom Fields (ACF)
  • Product meta fields
  • Third-party plugin fields
  • Custom taxonomies

4. Test and Validate

  1. Select a test product with the custom field
  2. Generate sample content
  3. Verify variable replacement works correctly
  4. Adjust mapping if needed

Custom Variable Examples

Example 1: Material Information

Setup:

  • Field: "product_material" (custom field)
  • Variable: \{material\}
  • Usage: "This product is made from {material}"

Result: "This product is made from 100% organic cotton"

Example 2: Technical Specifications

Setup:

  • Field: "technical_specs" (ACF field)
  • Variable: \{specs\}
  • Usage: "Technical specifications: {specs}"

Result: "Technical specifications: 1200W motor, 5-year warranty"

Example 3: Benefits List

Setup:

  • Field: "product_benefits" (meta field)
  • Variable: \{benefits\}
  • Usage: "Key benefits include: {benefits}"

Result: "Key benefits include: waterproof, lightweight, durable"

Managing Custom Variables

Variable List Interface

Display Information:

  • Variable name and code
  • Mapped field source
  • Usage count
  • Last modified date

Actions Available

  • Edit: Modify variable mapping
  • Delete: Remove variable (with usage warning)
  • Duplicate: Create similar variable
  • Test: Validate with sample product

Custom Fields Integration

Supported Field Types

WooCommerce Native Fields

  • Custom Product Fields: Added via plugins or custom code
  • Product Attributes: Size, color, material, etc.
  • Meta Fields: Additional product metadata
  • Variation Fields: Variable product specific data

Advanced Custom Fields (ACF)

  • Text Fields: Simple text input
  • Textarea Fields: Multi-line text
  • Select Fields: Dropdown selections
  • Checkbox Fields: Multiple selections
  • Number Fields: Numeric values

Third-Party Plugin Fields

  • WooCommerce Brands: Brand information
  • Product Add-ons: Additional product options
  • Custom Product Tabs: Extended product information
  • Specification Plugins: Technical details

Field Discovery

Automatic Detection

The plugin automatically scans for:

  • All registered custom fields
  • ACF field groups
  • Product attributes
  • Meta fields with values

Manual Field Addition

For fields not automatically detected:

  1. Note the field key/name
  2. Add manually in custom variables
  3. Test with products containing the field
  4. Verify proper data retrieval

Data Validation

Field Value Checking

Automatic Validation:

  • Empty field detection
  • Data type verification
  • Character encoding validation
  • HTML content sanitization

Error Handling:

  • Skip empty fields gracefully
  • Provide default values
  • Log validation issues
  • Continue generation process

Advanced Usage

Conditional Variables

Default Values

Use default values when fields are empty:

Material: \{material|Not specified\}

Conditional Content

Include content only when field has value:

\{material ? "Made from premium {material}" : ""\}

Variable Combinations

Multiple Field Usage

Combine multiple custom fields:

This \{category\} is crafted from \{material\} and features \{benefits\}.
Perfect for \{use_case\} with \{warranty\} warranty coverage.

Nested Variables

Use variables within other variables:

\{brand\} \{title\} - \{material\} \{category\} with \{features\}

HTML and Formatting

HTML Support (Advanced Mode)

Variables can include HTML formatting:

<h3>\{title\}</h3>
<p>Material: <strong>\{material\}</strong></p>
<ul>
  <li>Benefits: \{benefits\}</li>
  <li>Warranty: \{warranty\}</li>
</ul>

Text Formatting

Apply formatting to variable content:

\{title|uppercase\} - \{price|currency\} - \{material|capitalize\}

Best Practices

Variable Naming

Naming Conventions

Good Practices:

  • Descriptive: Use clear, meaningful names
  • Consistent: Follow a standard pattern
  • Short: Keep names concise but clear
  • Logical: Group related variables

Good Examples:

  • \{material\}, \{warranty\}, \{brand\}
  • \{tech_specs\}, \{dimensions\}, \{weight\}

Avoid:

  • {custom1}, {field2}, {x}
  • {very_long_descriptive_field_name}

Field Mapping Strategy

Planning Your Variables

  1. Audit Existing Fields: List all available custom fields
  2. Identify Key Information: Determine most important data
  3. Prioritize Variables: Focus on high-impact fields first
  4. Test Systematically: Validate each mapping thoroughly

Content Strategy

Essential Variables

  • Product specifications
  • Key benefits
  • Brand information
  • Usage instructions

Optional Variables

  • Detailed technical specs
  • Warranty information
  • Care instructions
  • Compatibility details

Prompt Design

Effective Prompt Templates

Structure Guidelines:

  1. Start with context setting
  2. Include key product variables
  3. Specify formatting requirements
  4. End with style/length instructions

Example Template:

Create a compelling product description for the \{brand\} \{title\}.

Product Details:
- Category: \{category\}
- Material: \{material\}
- Key Features: \{features\}
- Price: \{price\}

Highlight the \{benefits\} and explain why this \{category\}
is perfect for \{target_audience\}.

Write in a \{style\} tone, keep under \{max_length\} characters,
and optimize for \{language\} speakers.

Quality Assurance

Testing Variables

Validation Process:

  1. Test with products that have all fields populated
  2. Test with products missing some fields
  3. Verify default value handling
  4. Check HTML rendering (if applicable)

Content Review

Quality Checks:

  • Variable replacement accuracy
  • Content relevance and flow
  • Grammar and readability
  • Brand voice consistency

Troubleshooting Variables

Common Issues

Variable Not Replacing:

  • Check variable name spelling
  • Verify field mapping
  • Confirm field has value
  • Test with different products

Incorrect Data:

  • Validate field source
  • Check data format
  • Verify field permissions
  • Review custom field setup

HTML Issues:

  • Validate HTML syntax
  • Check character encoding
  • Test rendering in different contexts
  • Verify WordPress compatibility