Update Theme Template Part


Replaces a template part's markup — the header, footer or another reusable part — staged in the theme draft. Nothing changes for visitors until the draft is published. For a small wording change, such as the footer copyright line, use mosmcp/theme-text-replace instead.

Also known as: edit header, edit footer, change site header, change footer.

Property Value
Ability slug mosmcp/theme-part-update
Wire tool name mosmcp__theme-part-update
Category Theme: Templates and Styles (mosmcp-theme-blocks)
Plan Free

 

Required access

Requirement Value
Capability edit_theme_options
Minimum default role Administrator (Shop manager too when WooCommerce is active)
Annotations readOnly: false · destructive: false · idempotent: true · openWorld: false

 

Input schema

Field Type Required Default Description
slug string Yes — Template part slug, for example "header" or "footer".
content string Yes — The complete new block markup.

 

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[]

 

Example

Sample prompt
Replace my site footer with a simple centred copyright line.

Example request (json)

{
  "jsonrpc": "2.0",
  "id": 300,
  "method": "tools/call",
  "params": {
    "name": "mosmcp__theme-part-update",
    "arguments": {
      "input": {
        "slug": "footer",
        "content": "<!-- wp:paragraph {\"align\":\"center\"} -->
<p class=\"has-text-align-center\">(c) 2026 Example Co.</p>
<!-- /wp:paragraph -->" } } } }

Example response (json)

{
  "jsonrpc": "2.0",
  "id": 300,
  "result": {
    "isError": false,
    "structuredContent": {
      "staged": true,
      "target": "the template part \"footer\"",
      "change": "content updated",
      "draft": {
        "exists": true,
        "change_count": 1,
        "templates": [],
        "template_parts": [
          "footer (update)"
        ],
        "global_styles": "",
        "patterns": [],
        "files": [],
        "created": "2026-09-29 10:12:04",
        "updated": "2026-09-29 10:14:37",
        "preview_ready": true
      },
      "next_step": "Nothing has changed on the live site yet. Preview the draft with mosmcp/theme-draft-preview, then publish it with mosmcp/theme-draft-publish.",
      "notes": []
    }
  }
}

 

Edge cases / errors

  • Empty content -> refused with mosmcp_block_markup_empty; unbalanced block comments -> mosmcp_block_markup_broken.
  • content identical to what the part already holds -> refused with mosmcp_no_change.
  • Unknown slug -> mosmcp_template_part_not_found, listing the parts that exist.
  • Staged in the theme draft only; visitors see nothing until mosmcp/theme-draft-publish.

 


<< Previous Next >>
Update Theme Template Delete Theme File

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.