Find Elements is a WordPress ability from Page Builder: Pagelayer – Drag and Drop website builder — usable via Easy MCP AI, which connects Claude, ChatGPT, and any AI assistant to your site.

Install Free Plugin →

Find Elements

Read-only

Search a page's elements by widget tag and/or a text match against their content or attrs.

Requires the Pagelayer plugin on WordPress 6.9+ (or another source of wp_register_ability()) for the Abilities API — registration is skipped entirely via a function_exists() guard when it isn't available, and ability categories similarly require wp_register_ability_category(). Most abilities require the 'edit_posts' capability; update-global-styles, create-menu, and delete-menu require 'manage_options'. search-images additionally needs a Pexels API key configured on the Pagelayer AI Agents settings page, and get-library-sections/import-library-section call Pagelayer's own hosted library API. Four near-duplicate abilities (get-widget, get-widgets-summary, edit-layout, navigator) are registered in source with mcp_public:false — fully callable over the REST Abilities API but intentionally left out of the advertised MCP tool list as duplicates of get-widget-schema, list-widgets, update-page, and get-page respectively — and are excluded from this listing.

What it does

Walks a page's stored layout tree matching nodes by an optional tag filter and/or a case-insensitive substring match against each node's text preview, drawn from its content or its own text-bearing attrs, so it also matches widgets like pl_iconbox or pl_btn that keep their copy in attrs rather than node content. By default returns compact "id tag \"text\"" lines; include_attrs:true returns each match's full attrs instead, at a higher token cost.

See it in action

You ask your AI assistant

"Find every heading on page 128 that mentions "Contact"."

Inputs

Name Type Required Description
post_id integer Yes Page post ID.
tag string No Widget tag to filter by.
query string No Text to match against each node's preview.
include_attrs boolean No Include every attr of each match. Large — usually unnecessary.

Returns

An object with elements (array of compact match strings, or full node objects when include_attrs is true), count, and (unless include_attrs) a legend explaining the ref format.

Permission

Requires the 'edit_posts' capability.

Newsletter

The AI + WordPress space moves fast. Keep up.

New tools, workflow ideas, and product updates — be the first to know what's next.

No spam, unsubscribe anytime.