Search commands
The bricks search command lets you find elements across your entire site. Search by element type, global class, setting value, or post type. Useful for auditing content, finding where a specific component is used, or understanding what exists before making changes.
Basic usage
Section titled “Basic usage”bricks search elements [flags]At least one search filter is required. You can combine multiple filters to narrow results.
| Flag | Description |
|---|---|
--type <type> | Filter by element type (heading, button, image, etc.) |
--class <class> | Filter by global class name |
--setting <key=value> | Filter by a specific setting and value |
--post-type <type> | Limit to a post type: page, template, etc. |
--limit <N> | Maximum number of results to return |
--json | Output as JSON instead of the default table |
Find by element type
Section titled “Find by element type”bricks search elements --type headingPage Element ID Type Tag Text1460 abc123 heading h1 Welcome to Acme1460 def456 heading h2 Our Services1523 ghi789 heading h1 About Us1523 jkl012 heading h3 Our Team1587 mno345 heading h1 ContactThis returns every heading element across all pages, templates, and components.
Find by global class
Section titled “Find by global class”Track down everywhere a specific class is used.
bricks search elements --class fr-heroPage Element ID Type Classes1460 abc123 section fr-hero, section--l1523 xyz789 section fr-hero, bg--primary-darkWorks with ACSS utility classes, Frames component classes, and any custom global classes.
Find by setting value
Section titled “Find by setting value”Search for elements with a specific setting.
bricks search elements --setting tag=h1Page Element ID Type Text1460 abc123 heading Welcome to Acme1523 ghi789 heading About Us1587 mno345 heading ContactEvery h1 on the site, in one command. Handy for checking heading hierarchy.
Filter by post type
Section titled “Filter by post type”Narrow results to just pages, or just templates.
bricks search elements --type button --post-type pagePage Element ID Type Text1460 pqr678 button Get Started1460 stu901 button Learn More1523 vwx234 button Contact UsCombine filters
Section titled “Combine filters”Stack multiple flags to get specific.
bricks search elements --type heading --setting tag=h1 --post-type pageThis finds all h1 headings, but only on pages (not templates or components).
Limit results
Section titled “Limit results”bricks search elements --type image --limit 5Returns at most 5 matching elements.
JSON output
Section titled “JSON output”bricks search elements --type heading --limit 3 --json[ { "page_id": 1460, "page_title": "Homepage", "element_id": "abc123", "element_type": "heading", "settings": { "tag": "h1", "text": "Welcome to Acme", "_cssGlobalClasses": ["acss_import_text__white", "acss_import_fw__700"] } }, { "page_id": 1523, "page_title": "About", "element_id": "ghi789", "element_type": "heading", "settings": { "tag": "h1", "text": "About Us" } }, { "page_id": 1587, "page_title": "Contact", "element_id": "mno345", "element_type": "heading", "settings": { "tag": "h1", "text": "Contact" } }]JSON output is what you’ll want when piping results into another tool or feeding them to an AI agent.
Practical uses
Section titled “Practical uses”Audit heading structure across the site:
bricks search elements --type heading --json | jq '.[].settings.tag' | sort | uniq -cFind all buttons linking to a specific URL:
bricks search elements --type button --setting link=/pricingCheck which pages use a particular component class:
bricks search elements --class fr-pricing-tableCount images across all pages:
bricks search elements --type image --json | jq lengthRelated commands
Section titled “Related commands”bricks site pull— pull full page content once you’ve found what you’re looking forbricks classes find— search for global class definitions (not usages)bricks doctor— find structural problems on a specific page