ACF Product Box Block Generator
Convert product URLs to ACF Product Box block markup for WordPress. Fetch the page, extract details, generate the block comment, and copy to clipboard.
Workflow
- Get URL: From clipboard
{clipboard}, user message, or ask
- Fetch page: Use WebFetch or firecrawl to get product details
- Extract fields: Apply extraction rules below
- Generate block: Output ACF block comment markup
- Copy to clipboard:
echo '...' | pbcopy
Extraction Rules
Title
- Clean product name from page title or h1
- Remove brand clutter, ASIN codes, excessive keywords
- Improve wording for clarity
Image
- Best product image from
og:image or main product image
- Prefer high-resolution, clean product shots
Features
- Extract key specs/features from
<li> items or product bullet points
- Improve wording if needed for clarity
- 3-6 features is ideal
Prices
- Original price (strikethrough/was price)
- Discount percentage
- Current/sale price
- Price note (e.g., "Free shipping", "Prime eligible")
Badge
- Format: "SAVE X%" with color
#22c55e
- For free products: "FREE" with color
#22c55e
- Calculate from original vs current price if not explicit
Description
- Short one-line summary of the product
- Improve from page meta description or product summary
Button Rules
Amazon.com Products
Button 1 (Amazon US):
- URL: https://www.amazon.com/dp/{ASIN}/?tag=gtorg0f-20
- Style: "amazon"
- Icon: "cart"
- Text: "Check Price on Amazon"
Button 2 (Amazon India):
- URL: https://www.amazon.in/s?k={Product+Name+Keywords}&tag=gaurtiwa-21
- Style: "primary"
- Icon: "none"
- Class: "md-icon-external"
- Text: "Check on Amazon.in"
Non-Amazon Products
Button 1:
- URL: Product page URL (no affiliate tag unless one exists)
- Style: "primary"
- Icon: "none"
- Class: "md-icon-external"
- Text: "Check Price" or "Visit Website"
All Buttons
field_pb_cta_rel: "nofollow noopener sponsored"
ACF Block Format
CRITICAL: All field keys use the field_ prefix. Repeaters use nested row-N objects.
Standard (with image)
<!-- wp:acf/product-box {"name":"acf/product-box","data":{"field_pb_image":"","field_pb_image_url":"IMAGE_URL","field_pb_badge_text":"SAVE 15%","field_pb_badge_color":"#22c55e","field_pb_title":"Product Title","field_pb_title_url":"PRODUCT_URL","field_pb_rating":"4.5","field_pb_rating_count":"1,234 ratings","field_pb_features":{"row-0":{"field_pb_feature_text":"Feature one"},"row-1":{"field_pb_feature_text":"Feature two"},"row-2":{"field_pb_feature_text":"Feature three"}},"field_pb_original_price":"$99.99","field_pb_discount_percent":"-15%","field_pb_current_price":"$84.99","field_pb_price_note":"Free shipping","field_pb_description":"Short product description.","field_pb_buttons":{"row-0":{"field_pb_cta_text":"Check Price on Amazon","field_pb_cta_url":"https://www.amazon.com/dp/ASIN/?tag=gtorg0f-20","field_pb_cta_style":"amazon","field_pb_cta_icon":"cart","field_pb_cta_class":"","field_pb_cta_rel":"nofollow noopener sponsored"},"row-1":{"field_pb_cta_text":"Check on Amazon.in","field_pb_cta_url":"https://www.amazon.in/s?k=Product+Name&tag=gaurtiwa-21","field_pb_cta_style":"primary","field_pb_cta_icon":"none","field_pb_cta_class":"md-icon-external","field_pb_cta_rel":"nofollow noopener sponsored"}}},"mode":"preview"} /-->
No Image Variation
Add "className":"is-style-no-image" to block attributes. Omit field_pb_image and field_pb_image_url.
<!-- wp:acf/product-box {"name":"acf/product-box","className":"is-style-no-image","data":{"field_pb_badge_text":"FREE","field_pb_badge_color":"#22c55e","field_pb_title":"Product Title","field_pb_title_url":"PRODUCT_URL","field_pb_rating":"4.8","field_pb_rating_count":"500 ratings","field_pb_features":{"row-0":{"field_pb_feature_text":"Feature one"}},"field_pb_current_price":"Free","field_pb_description":"Short description.","field_pb_buttons":{"row-0":{"field_pb_cta_text":"Visit Website","field_pb_cta_url":"https://example.com","field_pb_cta_style":"primary","field_pb_cta_icon":"none","field_pb_cta_class":"md-icon-external","field_pb_cta_rel":"nofollow noopener sponsored"}}},"mode":"preview"} /-->
Field Reference
| Field |
Key |
Type |
Notes |
| Image ID |
field_pb_image |
string |
Empty "" when using URL |
| Image URL |
field_pb_image_url |
string |
Direct image URL |
| Badge Text |
field_pb_badge_text |
string |
"SAVE X%" or "FREE" |
| Badge Color |
field_pb_badge_color |
string |
Hex color, default #22c55e |
| Title |
field_pb_title |
string |
Clean product name |
| Title URL |
field_pb_title_url |
string |
Product page URL |
| Rating |
field_pb_rating |
string |
e.g., "4.5" |
| Rating Count |
field_pb_rating_count |
string |
e.g., "1,234 ratings" |
| Features |
field_pb_features |
repeater |
row-N > field_pb_feature_text |
| Original Price |
field_pb_original_price |
string |
e.g., "$99.99" |
| Discount |
field_pb_discount_percent |
string |
e.g., "-15%" |
| Current Price |
field_pb_current_price |
string |
e.g., "$84.99" |
| Price Note |
field_pb_price_note |
string |
e.g., "Free shipping" |
| Description |
field_pb_description |
string |
One-line summary |
| Buttons |
field_pb_buttons |
repeater |
See button fields below |
Button Sub-fields
| Field |
Key |
Values |
| Text |
field_pb_cta_text |
Button label |
| URL |
field_pb_cta_url |
Full URL with affiliate tag |
| Style |
field_pb_cta_style |
"amazon", "primary", "secondary" |
| Icon |
field_pb_cta_icon |
"none", "cart", "external", "download" |
| Class |
field_pb_cta_class |
"", "md-icon-external", "md-icon-download" |
| Rel |
field_pb_cta_rel |
"nofollow noopener sponsored" |
Affiliate Tags
| Store |
Tag |
URL Pattern |
| Amazon.com |
gtorg0f-20 |
amazon.com/dp/{ASIN}/?tag=gtorg0f-20 |
| Amazon.in |
gaurtiwa-21 |
amazon.in/s?k={Keywords}&tag=gaurtiwa-21 |
Output
- Generate the block comment markup
- Copy to clipboard:
echo 'BLOCK_MARKUP' | pbcopy
- Show the user a summary of what was extracted
1---2name: product-box-block3description: Convert a URL (from clipboard or user input) to an ACF Product Box Block. Fetches the page, extracts product details, and outputs WordPress block markup. Use when the user pastes a product URL, mentions "product box," "ACF product box," or wants to convert a product page to a Gutenberg block.4---56# ACF Product Box Block Generator78Convert product URLs to ACF Product Box block markup for WordPress. Fetch the page, extract details, generate the block comment, and copy to clipboard.910## Workflow11121. **Get URL**: From clipboard `{clipboard}`, user message, or ask132. **Fetch page**: Use WebFetch or firecrawl to get product details143. **Extract fields**: Apply extraction rules below154. **Generate block**: Output ACF block comment markup165. **Copy to clipboard**: `echo '...' | pbcopy`1718## Extraction Rules1920### Title21- Clean product name from page title or h122- Remove brand clutter, ASIN codes, excessive keywords23- Improve wording for clarity2425### Image26- Best product image from `og:image` or main product image27- Prefer high-resolution, clean product shots2829### Features30- Extract key specs/features from `<li>` items or product bullet points31- Improve wording if needed for clarity32- 3-6 features is ideal3334### Prices35- Original price (strikethrough/was price)36- Discount percentage37- Current/sale price38- Price note (e.g., "Free shipping", "Prime eligible")3940### Badge41- Format: "SAVE X%" with color `#22c55e`42- For free products: "FREE" with color `#22c55e`43- Calculate from original vs current price if not explicit4445### Description46- Short one-line summary of the product47- Improve from page meta description or product summary4849## Button Rules5051### Amazon.com Products52```53Button 1 (Amazon US):54- URL: https://www.amazon.com/dp/{ASIN}/?tag=gtorg0f-2055- Style: "amazon"56- Icon: "cart"57- Text: "Check Price on Amazon"5859Button 2 (Amazon India):60- URL: https://www.amazon.in/s?k={Product+Name+Keywords}&tag=gaurtiwa-2161- Style: "primary"62- Icon: "none"63- Class: "md-icon-external"64- Text: "Check on Amazon.in"65```6667### Non-Amazon Products68```69Button 1:70- URL: Product page URL (no affiliate tag unless one exists)71- Style: "primary"72- Icon: "none"73- Class: "md-icon-external"74- Text: "Check Price" or "Visit Website"75```7677### All Buttons78- `field_pb_cta_rel`: `"nofollow noopener sponsored"`7980## ACF Block Format8182**CRITICAL**: All field keys use the `field_` prefix. Repeaters use nested `row-N` objects.8384### Standard (with image)8586```html87<!-- wp:acf/product-box {"name":"acf/product-box","data":{"field_pb_image":"","field_pb_image_url":"IMAGE_URL","field_pb_badge_text":"SAVE 15%","field_pb_badge_color":"#22c55e","field_pb_title":"Product Title","field_pb_title_url":"PRODUCT_URL","field_pb_rating":"4.5","field_pb_rating_count":"1,234 ratings","field_pb_features":{"row-0":{"field_pb_feature_text":"Feature one"},"row-1":{"field_pb_feature_text":"Feature two"},"row-2":{"field_pb_feature_text":"Feature three"}},"field_pb_original_price":"$99.99","field_pb_discount_percent":"-15%","field_pb_current_price":"$84.99","field_pb_price_note":"Free shipping","field_pb_description":"Short product description.","field_pb_buttons":{"row-0":{"field_pb_cta_text":"Check Price on Amazon","field_pb_cta_url":"https://www.amazon.com/dp/ASIN/?tag=gtorg0f-20","field_pb_cta_style":"amazon","field_pb_cta_icon":"cart","field_pb_cta_class":"","field_pb_cta_rel":"nofollow noopener sponsored"},"row-1":{"field_pb_cta_text":"Check on Amazon.in","field_pb_cta_url":"https://www.amazon.in/s?k=Product+Name&tag=gaurtiwa-21","field_pb_cta_style":"primary","field_pb_cta_icon":"none","field_pb_cta_class":"md-icon-external","field_pb_cta_rel":"nofollow noopener sponsored"}}},"mode":"preview"} /-->88```8990### No Image Variation9192Add `"className":"is-style-no-image"` to block attributes. Omit `field_pb_image` and `field_pb_image_url`.9394```html95<!-- wp:acf/product-box {"name":"acf/product-box","className":"is-style-no-image","data":{"field_pb_badge_text":"FREE","field_pb_badge_color":"#22c55e","field_pb_title":"Product Title","field_pb_title_url":"PRODUCT_URL","field_pb_rating":"4.8","field_pb_rating_count":"500 ratings","field_pb_features":{"row-0":{"field_pb_feature_text":"Feature one"}},"field_pb_current_price":"Free","field_pb_description":"Short description.","field_pb_buttons":{"row-0":{"field_pb_cta_text":"Visit Website","field_pb_cta_url":"https://example.com","field_pb_cta_style":"primary","field_pb_cta_icon":"none","field_pb_cta_class":"md-icon-external","field_pb_cta_rel":"nofollow noopener sponsored"}}},"mode":"preview"} /-->96```9798## Field Reference99100| Field | Key | Type | Notes |101|-------|-----|------|-------|102| Image ID | `field_pb_image` | string | Empty `""` when using URL |103| Image URL | `field_pb_image_url` | string | Direct image URL |104| Badge Text | `field_pb_badge_text` | string | "SAVE X%" or "FREE" |105| Badge Color | `field_pb_badge_color` | string | Hex color, default `#22c55e` |106| Title | `field_pb_title` | string | Clean product name |107| Title URL | `field_pb_title_url` | string | Product page URL |108| Rating | `field_pb_rating` | string | e.g., "4.5" |109| Rating Count | `field_pb_rating_count` | string | e.g., "1,234 ratings" |110| Features | `field_pb_features` | repeater | `row-N` > `field_pb_feature_text` |111| Original Price | `field_pb_original_price` | string | e.g., "$99.99" |112| Discount | `field_pb_discount_percent` | string | e.g., "-15%" |113| Current Price | `field_pb_current_price` | string | e.g., "$84.99" |114| Price Note | `field_pb_price_note` | string | e.g., "Free shipping" |115| Description | `field_pb_description` | string | One-line summary |116| Buttons | `field_pb_buttons` | repeater | See button fields below |117118### Button Sub-fields119120| Field | Key | Values |121|-------|-----|--------|122| Text | `field_pb_cta_text` | Button label |123| URL | `field_pb_cta_url` | Full URL with affiliate tag |124| Style | `field_pb_cta_style` | `"amazon"`, `"primary"`, `"secondary"` |125| Icon | `field_pb_cta_icon` | `"none"`, `"cart"`, `"external"`, `"download"` |126| Class | `field_pb_cta_class` | `""`, `"md-icon-external"`, `"md-icon-download"` |127| Rel | `field_pb_cta_rel` | `"nofollow noopener sponsored"` |128129## Affiliate Tags130131| Store | Tag | URL Pattern |132|-------|-----|-------------|133| Amazon.com | `gtorg0f-20` | `amazon.com/dp/{ASIN}/?tag=gtorg0f-20` |134| Amazon.in | `gaurtiwa-21` | `amazon.in/s?k={Keywords}&tag=gaurtiwa-21` |135136## Output1371381. Generate the block comment markup1392. Copy to clipboard: `echo 'BLOCK_MARKUP' | pbcopy`1403. Show the user a summary of what was extracted