wp_clone_and_customize
Clone a source Elementor page into N variants, applying each variant's find/replace to its clone — all server-side, in ONE call. Built for the 'one source page -> many near-identical variants with swapped terminology' pattern (e.g. specialty landing pages). Instead of N clone calls + N patches carrying full page payloads, send a source id + a compact list of variants. Returns per-variant {post_id, title, replacements_made} — never page content. Each variant is a draft you review. Round-trip validated; write-gated. For an INTELLIGENT transform beyond literal swaps (related conditions/procedures/language), run assist_transform_page on a clone instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| post_id | Yes | The SOURCE page/post ID to clone from | |
| site_id | Yes | The WordPress site ID | |
| variants | Yes | JSON array of variants, e.g. [{"title":"Pulmonologist Marketing","slug":"pulmonologist","replacements":[{"find":"urolog","replace":"pulmonolog"}]}] — each: {title, slug?, status?, replacements:[{find,replace}], whole_word?, case_insensitive?} |