Install a theme from a ZIP
wp_install_theme_zipInstall a WordPress theme from a ZIP file via base64 content, a public URL, or an upload session, with an optional switch to it after install and a preview token guarding the change.
Instructions
Install a theme from a ZIP archive: base64 "content" or a public http(s) "url" the site downloads, each up to 30 MB by default; where AlphaBridge MCP Pro is active, also a committed upload "session" of its chunked uploads, for larger archives. A session given is used first, then content, then url. Optionally switches to it. Themes from the WordPress.org directory are installed by slug with wp_install_theme. Needs install_themes (and switch_themes for activate; without it activated stays false); refused when DISALLOW_FILE_MODS is set. Returns installed, stylesheet and activated, plus what the activation check reports. The install records no undo point; with activate, the theme switch records one where it can, returned in undo as with wp_activate_theme (null when none was recorded). Where the theme's folder exists already, nothing is changed and the answer names the version installed, so a repeated call installs nothing twice; an installed theme is brought to a newer version with wp_update_theme. With activate, the activation is checked as with wp_activate_plugin and wp_activate_theme: where the site does worse with it active, it is taken back in the same call, and the answer, an error, names the error with file and line; what was installed stays installed. Runs in two steps: a call without confirm_token changes nothing and returns a preview with a confirm_token, and the same call with that token runs it. This guards against a call nobody meant; it does not make the change reversible.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | Public http or https address of a theme .zip; the site downloads it (up to 30 MB by default, three redirects). Used when neither session nor content is given. | |
| content | No | Base64-encoded theme .zip, up to 30 MB by default (filter ab_mcp_install_max_bytes). | |
| session | No | Id of a committed chunked-upload session of AlphaBridge MCP Pro holding the .zip, for archives over the content and url limit; used first when given. Refused where Pro is not active. | |
| activate | No | true switches to the theme after install (needs switch_themes). Default false. | |
| confirm_token | No | Confirmation from the preview: a call without it changes nothing and answers with a preview and a confirm_token, and the same arguments with that token run the tool. A token is valid for 10 minutes and only while what it covers is unchanged. |