Validation rules
The Advanced Product Feeds module automatically validates generated feed files according to a predefined set of rules.
Go to Catalog > Advanced Product Feeds > Feeds > Choose the feed > Content settings > Validation Rules (JSON)
These rules help ensure that your feed is compatible with marketplace requirements (such as Google Merchant Center) and contains valid data. For detailed instructions on how to run and review validation results, see how to validate the feed.
Each rule specifies:
- Type: the kind of check performed (e.g.
required,max_length,is_one_of) - Severity: how critical the issue is (
error,warning,notice,improvement) - Message: description of the problem or recommendation
- Additional parameters: optional, depending on the rule type (e.g.
length,values)
Check the types reference for more information.
Severity classification
| Severity | Description |
|---|---|
| Error | Critical issue that can cause feed rejection |
| Warning | Problem that may affect feed quality or cause partial rejection |
| Notice | Informational note or minor formatting issue |
| Improvement | Optional recommendation to enhance data quality |
Types of Rules
Each validation rule defines how the module checks a specific field’s value.
You can combine multiple rules per field (for example: required + max_length).
The table below lists all available rule types, their descriptions, and any additional parameters required.
| Type | Description | Additional Field(s) |
|---|---|---|
| required | Checks that the field exists and is not empty. | — |
| max_length | Ensures that the field value does not exceed the specified length. | length — maximum allowed characters |
| min_length | Ensures that the field value is at least the specified length. | length — minimum required characters |
| start_with | Checks that the field value begins with one of the allowed prefixes. | values — array of allowed prefixes (e.g. ["https://", "http://"]) |
| end_with | Checks that the field value ends with one of the allowed suffixes. | values — array of allowed endings (e.g. ["kg", "g", "lb"]) |
| is_one_of | Validates that the field value matches one of the allowed values. | values — array of permitted values |
| alphanumeric | Ensures that the field contains only alphanumeric characters. | — |
| ascii | Ensures that the field contains only ASCII characters. | — |
| unicode | Validates that the field contains valid Unicode characters. | — |
| numeric | Ensures that the field contains only numeric values. | — |
| without_html | Checks that the field does not include HTML tags. | — |
If a rule requires extra parameters, they are declared inside the module’s PHP validator class as constants:
private const KEY_MIN_LENGTH = 'length';
private const KEY_ALLOWED_VALUES = 'values';
Field-based validation rules
Below is the list of all currently used validation rules by field for Google Shopping feed.
g:id
| Description | Type | Severity |
|---|---|---|
| ID is a required attribute | required | error |
| The maximum length of an ID is 50 characters | max_length (50) | warning |
| Only valid Unicode characters are allowed for IDs | unicode | warning |
g:item_group_id
| Description | Type | Severity |
|---|---|---|
| The maximum length of an item group ID is 50 characters | max_length (50) | notice |
| Only valid Unicode characters are allowed for item group IDs | unicode | notice |
title
| Description | Type | Severity |
|---|---|---|
| Title is a required attribute | required | error |
| The maximum length of a title is 150 characters | max_length (150) | warning |
link
| Description | Type | Severity |
|---|---|---|
| Link is a required attribute | required | error |
A link should start with http or https | start_with | error |
g:price
| Description | Type | Severity |
|---|---|---|
| Price is a required attribute | required | error |
description
| Description | Type | Severity |
|---|---|---|
| Description is a required attribute | required | error |
g:product_type
| Description | Type | Severity |
|---|---|---|
| The maximum length of a product type is 750 characters | max_length (750) | notice |
| Only alphanumeric characters are allowed for product types | ascii | notice |
g:image_link
| Description | Type | Severity |
|---|---|---|
| Image link is a required attribute | required | error |
An image link should start with http or https | start_with | error |
g:additional_image_link
| Description | Type | Severity |
|---|---|---|
An additional image link should start with http or https | start_with | notice |
g:condition
| Description | Type | Severity |
|---|---|---|
The condition attribute supports only the values: new, refurbished, used | is_one_of | notice |