Skip to main content

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

SeverityDescription
ErrorCritical issue that can cause feed rejection
WarningProblem that may affect feed quality or cause partial rejection
NoticeInformational note or minor formatting issue
ImprovementOptional 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.

TypeDescriptionAdditional Field(s)
requiredChecks that the field exists and is not empty.
max_lengthEnsures that the field value does not exceed the specified length.length — maximum allowed characters
min_lengthEnsures that the field value is at least the specified length.length — minimum required characters
start_withChecks that the field value begins with one of the allowed prefixes.values — array of allowed prefixes (e.g. ["https://", "http://"])
end_withChecks that the field value ends with one of the allowed suffixes.values — array of allowed endings (e.g. ["kg", "g", "lb"])
is_one_ofValidates that the field value matches one of the allowed values.values — array of permitted values
alphanumericEnsures that the field contains only alphanumeric characters.
asciiEnsures that the field contains only ASCII characters.
unicodeValidates that the field contains valid Unicode characters.
numericEnsures that the field contains only numeric values.
without_htmlChecks that the field does not include HTML tags.
How rule parameters are defined

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

DescriptionTypeSeverity
ID is a required attributerequirederror
The maximum length of an ID is 50 charactersmax_length (50)warning
Only valid Unicode characters are allowed for IDsunicodewarning

g:item_group_id

DescriptionTypeSeverity
The maximum length of an item group ID is 50 charactersmax_length (50)notice
Only valid Unicode characters are allowed for item group IDsunicodenotice

title

DescriptionTypeSeverity
Title is a required attributerequirederror
The maximum length of a title is 150 charactersmax_length (150)warning
DescriptionTypeSeverity
Link is a required attributerequirederror
A link should start with http or httpsstart_witherror

g:price

DescriptionTypeSeverity
Price is a required attributerequirederror

description

DescriptionTypeSeverity
Description is a required attributerequirederror

g:product_type

DescriptionTypeSeverity
The maximum length of a product type is 750 charactersmax_length (750)notice
Only alphanumeric characters are allowed for product typesasciinotice
DescriptionTypeSeverity
Image link is a required attributerequirederror
An image link should start with http or httpsstart_witherror
DescriptionTypeSeverity
An additional image link should start with http or httpsstart_withnotice

g:condition

DescriptionTypeSeverity
The condition attribute supports only the values: new, refurbished, usedis_one_ofnotice