wp_insert_shortcode
Insert HTML or shortcodes before or after a specific shortcode tag on a WordPress page, with dry-run preview to verify placement before saving.
Instructions
Insert new content before or after an existing shortcode in a page.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"page_id": "<page_id>",
"anchor_tag": "<anchor_tag>",
"position": "<position>",
"new_content": "<new_content>"
},
"name": "wp_insert_shortcode"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dry_run | No | Preview changes without writing | |
| page_id | Yes | Page ID | |
| position | Yes | ||
| anchor_tag | Yes | Anchor shortcode tag | |
| occurrence | No | Zero-based occurrence after anchor filtering | |
| new_content | Yes | Shortcode or HTML to insert | |
| anchor_match_attr | No | Attribute used to disambiguate | |
| anchor_match_value | No | Required attribute substring |