Sometimes a product value is almost right for a channel but needs a tweak — a title that’s too long, a description full of HTML, a size that should be uppercase, or a date that needs the exact format Google wants. Commands let you reshape an attribute’s value as it’s written to the feed, without editing a single product. This guide explains how CTX Feed’s Command Builder works, what each command does, and how to combine them into a formatting pipeline.
This feature requires CTX Feed Pro. On the free plugin the Command field is dimmed with a PRO badge, and clicking it opens an upgrade window instead of the builder.
Where commands live
Commands attach to a single mapping row on the Make Feed screen.
- Go to CTX Feed → Make Feed, or edit an existing feed from Manage Feeds.
- Stay on the Config tab.
- Expand a row’s extra options — click More on that row, or Show prefix / suffix / command at the top of the table to expand every row.
- In the expanded area you’ll see a Command field. Click it (the Build button) to open the Build output command dialog.

- More — expands the row’s extra options; the button then reads Less.
- Command — shows the row’s command, or “No command”; click it to open the builder.

- Steps — run top to bottom; reorder with the arrows.
- Add step — pick a command from the grouped list.
- Keep the original value if the result is empty — adds
[…]to the end of the chain. - Live preview — a real product’s value before and after the commands.
A row’s value is processed in this order: the Output type you picked (such as Price or Strip Tags), then the command, then the prefix and suffix.
Because commands are per row, each attribute can have its own formatting — you might truncate the title, strip HTML from the description, and uppercase the color, all in the same feed.
How the Command Builder works
The builder assembles a pipeline of steps that run top to bottom — the output of one step becomes the input to the next.
- Click Add step and pick a command from the grouped dropdown.
- Fill in any fields the command needs (for example, a length for Truncate, or find/replace text for Replace).
- Add more steps and use the up/down arrows to reorder them — order matters, since each step transforms the running value.
- Watch the Live preview panel: it shows a real product’s value before → after so you can confirm the result before saving.
- Leave Keep the original value if the result is empty switched on (the default) unless you have a reason not to — it protects you from blanking a field when a command produces nothing.
- Click Apply, then Save & generate to save and regenerate.
Under the hood the builder writes a compact command string such as [uppercase], [truncate 0 80], […]. You never have to type that by hand, but you can — click Edit as text to edit the raw string, and Back to builder to return.
The command catalogue
Commands are grouped by what they do:
Text case
- Uppercase, Lowercase — force the value’s case.
- Capitalize — lowercase the value, then capitalize the first letter; Capitalize words — lowercase, then capitalize each word (so
iPhone CASEbecomesIphone Case); Sentence case — capitalize the first letter of the sentence.
Clean up
- Remove HTML, Remove shortcodes — strip markup and WordPress shortcodes (great for descriptions).
- Remove page-builder markup — strip the leftovers that page builders put into descriptions.
- Encode entities, Encode special characters — make the value safe for the file format.
- Clean invalid characters, Remove emojis, Trim, Collapse spaces, Remove newlines — tidy up messy text.
Cut & replace
- Truncate — cut to a maximum number of characters (for example, a 150-character title limit). HTML tags are removed first.
- Truncate words — cut to a maximum number of words. HTML tags are removed first.
- Extract — look for a list of words or phrases (separated by
|) in the value and output the one found — the first listed word, or all of them. Options: case-sensitive, whole words only, regular expression. This is Google Merchant Center’s “Extract” rule done in the feed, the usual way to derive color, gender or material from a title. Nothing found gives an empty value. - Split & choose — split the value on a separator (comma, pipe, space… or a custom one) and keep the first node, the last node, a node at a position (1 is the first, -1 is the last) or a range of nodes joined back together. This is the same job as Google Merchant Center’s “Split & Choose” attribute rule, done in the feed itself so it also works for channels that have no such rule. A position that does not exist gives an empty value.
- Replace — find text and replace it (leave the replacement empty to delete the found text).
- Pattern replace — a regular-expression find/replace for advanced cases.
- If empty — output a fallback text when the value is empty or only spaces. The text can’t contain commas or square brackets.
Numbers
- Format number — set decimals and the decimal/thousands separators.
- Round, Integer — round to a precision or drop the decimals.
- Multiply, Add — scale or offset a number (for example, Multiply by
1.2to add 20% VAT, then Round to 2). A value that isn’t a plain number is left unchanged.
Dates
- Format date — reformat a date using a preset (including ISO 8601, which Google requires for
availability_dateandsale_price_effective_date) or a custom format.
Links & XML
- HTTPS links / HTTP links — force link protocol.
- CDATA wrap, Strip invalid XML, Decode entities — control how values render inside XML feeds.
- Set URL parameter — add or replace a query parameter on a URL (for example a tracking tag).
?or&is chosen for you and an existing parameter with the same name is replaced — Google Merchant Center’s “Optimize URL” rule. Use this instead of typing?name=valueinto Suffix, which breaks on stores with plain permalinks. - Remove URL parameter — drop one query parameter from a URL.
- Remove URL query string — drop every query parameter from a URL.
Variable products
- Variable product value, Variable product value first, Variable product value if empty — pull the value from the parent variable product instead of (or as a fallback for) the variation.
Worked examples
- Trim a long title to Google’s limit — add Truncate with length
150. - Clean a description — add Remove HTML, then Collapse spaces, then Truncate to a sensible length.
- Tag the product link for a campaign — on the link row add Set URL parameter with name
utm_sourceand valuegoogle;https://shop.test/?product=shirtbecomeshttps://shop.test/?product=shirt&utm_source=google. - Fill color from the title — map color to the title, add Extract with
Red|Blue|Green|Black;Classic BLUE hoodiewritesBlue. - Keep only the first image of a comma-separated list — add Split & choose with Split by comma and Keep first node;
a.jpg, b.jpg, c.jpgbecomesa.jpg. - Normalize sizes — add Uppercase so
smallbecomesSMALL. - Fix a date for Google — add Format date with the ISO 8601 preset.
- Provide a fallback — add If empty with text like
Genericso an empty brand never ships blank.
Editing the command as text
Advanced users can type the string directly. The syntax is bracketed commands joined by commas, running left to right: [remove-html], [truncate 0 150], […]. The trailing […] is the “keep original if empty” fallback. If you paste a string the visual builder can’t represent, the dialog opens in text mode so nothing is lost.
Troubleshooting
- The Command field is locked. Commands require CTX Feed Pro. Free feeds still generate — just without command formatting.
- The value came out empty. A command produced nothing (for example, Truncate to
0). Keep the Keep the original value if the result is empty toggle on, and check each step in the live preview. - My date isn’t reformatting. The source value must be a real date. Map a date attribute (like Sale Price Effective Date or Availability Date) before applying Format date.
- The live preview is blank. It needs at least one product to resolve against and a non-empty command. Add a product, or check that the row’s Value points at a real attribute.
- Order looks wrong. Steps run top to bottom — reorder with the arrows. For example, put Replace before Truncate so the cut happens on the final text.
- Multiply or Add did nothing. The value isn’t a plain number — for example it already has a currency code or a thousands separator. Add the currency with the row’s Suffix (it’s applied after the command) and keep thousands separators out of the price.
Related guides
- How to add a custom value to an attribute using pattern
- How to include value added tax (VAT) in my prices
- How to add sale price into feed

Hi!
I want to replace all empty descriptions with a “there’s no description here!” description.
Is there a command for “empty” or something similar?
I was thinking about the str_replace command, but I can’t find the word for empty.
Thanks!
Hi! You can do it using Dynamic attribute if you are using the pro version of CTX Feed. To know how, please, contact us from here – webappick.com/contact
Hi,
If I want to put all the product title in lowercase except the first string of each word .
An Example would be:
My Website: SNEAKERS BLUE
I need: Sneakers Blue
In the output type I can make this: ucwords , strtolower ?
Hi, You can simply use ucword as the output type as shown here and the titles will be converted to your desired format.