How to limit a customized block to one on a product page?

Topic summary

A developer created a custom app that adds a JavaScript widget as a block on Shopify product pages and wants to restrict it to only one instance per page.

Attempted Solution:

  • Tried adding "max_blocks": 1 to the block schema in the Liquid file
  • The configuration appears to target the block under the “section” with name “abc-widget”

Current Issue:

  • Even after adding the max_blocks parameter, users can still add multiple similar blocks under product information
  • When deploying the extension, an error occurs: “Invalid ‘max_blocks’ - unknown key at ‘schema’”

Status: The issue remains unresolved. The max_blocks property may not be supported in the current schema configuration or is being implemented incorrectly, causing deployment errors.

Summarized with AI on November 23. AI used: claude-sonnet-4-5-20250929.

Hi Team,

we have create a customized app to add js widget on product page in form of block.

We want to limit adding that to 1 .

however we tried adding “max_blocks”: 1 on liquid file

{% schema %}
{
“name”: “abc-widget”,
“target”: “section”,

“available_if”: “{{ app.metafields.abc_configs.abc_billing_present }}”
}
{% endschema %}

1 Like

Hi Niyeepo,

Thanks for quick response.

Even adding “max_blocks”: 1 still able to add similar blocks under product information

deploying extension getting error Invalid tag ‘schema’: unknown key │
│ ‘max_blocks’