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.
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 |