Update Additional CSS


Stages a change to the site's Additional CSS in the theme draft: "append" adds rules at the end (the safe default), "edit" swaps one exact piece of the existing CSS for new text, and "replace" sets the whole CSS. CSS that would break the page — HTML inside it, or an unclosed rule that would swallow every rule after it — is refused. Visitors see nothing until the draft is published; preview it first with mosmcp/theme-draft-preview.

Also known as: add custom CSS, change site CSS, style tweak.

Property Value
Ability slug mosmcp/site-css-update
Wire tool name mosmcp__site-css-update
Category Theme: Custom CSS and Settings (mosmcp-theme-customize)
Plan Free

 

Required access

Requirement Value
Capability edit_css
Minimum default role Administrator
Annotations readOnly: false · destructive: false · idempotent: false · openWorld: false

 

Input schema

Field Type Required Default Description
mode string (one of append, edit, replace) append "append" to add CSS at the end, "edit" to change one exact piece, "replace" to set all of it.
css string — For append and replace: the CSS.
find string — For edit: the exact text to change, copied from mosmcp/site-css-get.
replace_with string — For edit: the new text; empty to delete the found text.
all boolean — For edit: change every occurrence when the text appears more than once.
target string (one of auto, global_styles, customizer) auto "auto" (the active theme's own place), "global_styles" (the Site Editor, block themes) or "customizer".

 

Output schema

Field Type Required Description
staged boolean Yes
target string
change string
draft object Yes
draft.exists boolean
draft.change_count integer
draft.templates string[]
draft.template_parts string[]
draft.global_styles string
draft.patterns string[]
draft.files string[]
draft.site_identity string[] Pending logo and site icon changes.
draft.custom_css string[] Pending change to the Customizer's Additional CSS. A block theme's Additional CSS is part of global styles.
draft.theme_settings string[] Pending theme (Customizer) settings.
draft.created string
draft.updated string
draft.preview_ready boolean
next_step string
notes string[]
css string The whole Additional CSS once the draft is published.
bytes integer
matches integer For edit: how many times the found text appeared.

 


<< Previous Next >>
List Theme Settings Update Theme Settings

For more information about the Secure MCP Server for WordPress plugin, explore the following resources:

Product Overview | Pricing | Try for Free | Documentation

If you have any questions regarding plugin configuration, pricing plans or licensing, please contact us or mail us at aisupport@xecurify.com.