Change Element Styles 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 →

Change Element Styles

Write

Batch-apply style property changes to page elements matched by ID, pagelayer-id, or widget tag.

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

Takes an array of {selector, props} pairs — selector may be a pagelayer-id, an "@0.1.2" position path, or a bare widget tag to match every instance — and merges each matching node's attrs with the given props, after the same inline-CSS scrub applied to every attrs write. This is the cheap way to restyle several elements, e.g. every pl_btn on a page, in one call instead of one update-element call per node.

See it in action

You ask your AI assistant

"Change every button on page 128 to use the accent color and a larger border radius."

Inputs

Name Type Required Description
post_id integer Yes Target page ID.
styles array Yes [{selector, props}, ...].

Returns

An object with success:true and changes_applied (count of matched-and-updated nodes), or a WP_Error if the post has no data, no styles were given, or inline CSS was found in the props.

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.