Delete a theme file
delete_theme_fileDelete a file from a WordPress theme draft. Safeguards live themes and blocks removal of required templates.
Instructions
Delete a file from a theme draft. Refuses to touch a live active theme unless explicitly allowed. Deleting a required template (index.php, style.css) breaks the theme.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path relative to the theme root. | |
| theme | No | Theme stylesheet or draft id. | |
| confirm | No | Required — the file is removed from the server. | |
| site_id | No | Which configured WordPress site to act on. Optional — with a single site configured it is used automatically; with several, the default site is used unless you name one. Run list_sites for valid ids. | |
| allow_live_theme | No | Permit acting on the live active theme. Use a draft instead. |