Contents
On this page

Duplicate Recipe - Plugixa Recipe

POST /plugixa-recipe/v1/recipes/{id}/duplicate

Copy a recipe into a new draft.

Needs the plugixa_recipe_edit capability, or WordPress’s edit_posts (Contributor and up).

Request

POST https://your-site.example/wp-json/plugixa-recipe/v1/recipes/12/duplicate

Path parameters

Name Type Description
id integer The recipe’s id

Responses

200 OK. data is the new recipe, read back in full.

{
  "success": true,
  "message": "",
  "data": {
    "id": "13",
    "language_code": "",
    "translation_group": "",
    "title": "Lemon Pancakes (Copy)",
    "slug": "lemon-pancakes-copy",
    "description": "<p>Light, fluffy pancakes with lemon zest.</p>",
    "excerpt": "",
    "notes": "",
    "tips": "",
    "image_id": "345",
    "gallery": null,
    "tags": [
      "breakfast",
      "brunch"
    ],
    "equipment": [
      "Frying pan"
    ],
    "video_url": "",
    "servings": "4",
    "servings_unit": "servings",
    "yield_amount": "",
    "yield_unit": "",
    "prep_time": "10",
    "cook_time": "15",
    "rest_time": null,
    "total_time": "25",
    "difficulty": "easy",
    "cost": "budget",
    "season": "",
    "status": "draft",
    "is_featured": "0",
    "is_editor_pick": "0",
    "display_order": "0",
    "source": "",
    "source_url": "",
    "author_name": "",
    "view_count": "0",
    "rating_average": "0.00",
    "rating_count": "0",
    "like_count": "0",
    "enable_schema": "1",
    "canonical_post_id": null,
    "seo_score": null,
    "seo_title": null,
    "seo_description": null,
    "seo_keywords": null,
    "focus_keyword": null,
    "is_vegetarian": "1",
    "is_vegan": "0",
    "is_gluten_free": "0",
    "is_dairy_free": "0",
    "is_keto": "0",
    "is_low_carb": "0",
    "is_nut_free": "0",
    "is_paleo": "0",
    "is_sugar_free": "0",
    "is_halal": "0",
    "is_kosher": "0",
    "published_at": null,
    "created_at": "2026-11-12 10:20:00",
    "created_by": "1",
    "submission_ip": null,
    "modified_at": null,
    "modified_by": null,
    "image_url": "https://your-site.example/wp-content/uploads/2026/11/lemon-pancakes-1024x683.jpg",
    "image_thumbnail": "https://your-site.example/wp-content/uploads/2026/11/lemon-pancakes-150x150.jpg",
    "equipment_items": [
      {
        "name": "Frying pan",
        "link_url": ""
      }
    ],
    "categories": [
      {
        "id": "3",
        "language_code": "",
        "translation_group": "",
        "name": "Breakfast",
        "slug": "breakfast",
        "description": "",
        "image_id": null,
        "display_order": "0",
        "created_at": "2026-11-01 08:00:00"
      }
    ],
    "cuisines": [],
    "courses": [
      {
        "id": "8",
        "name": "Breakfast",
        "slug": "breakfast",
        "description": null,
        "display_order": "7"
      }
    ],
    "category_id": 3,
    "category_ids": [
      3
    ],
    "cuisine_id": 0,
    "course_id": 8,
    "ingredients": [
      {
        "id": "101",
        "recipe_id": "12",
        "group_name": "",
        "group_order": "0",
        "sort_order": "0",
        "quantity": "2",
        "unit": "cups",
        "name": "flour",
        "notes": "",
        "link_url": "",
        "amount": "2.000",
        "amount_max": null,
        "is_optional": "0",
        "substitution": ""
      },
      {
        "id": "102",
        "recipe_id": "12",
        "group_name": "",
        "group_order": "0",
        "sort_order": "1",
        "quantity": "1 1/2",
        "unit": "cups",
        "name": "milk",
        "notes": "",
        "link_url": "",
        "amount": "1.500",
        "amount_max": null,
        "is_optional": "0",
        "substitution": "oat milk"
      }
    ],
    "instructions": [
      {
        "id": "201",
        "recipe_id": "12",
        "group_name": "",
        "group_order": "0",
        "sort_order": "0",
        "title": "",
        "instruction_text": "Whisk the flour, milk and lemon zest.",
        "image_id": null,
        "video_url": "",
        "duration": null,
        "timer_seconds": null,
        "tip": "",
        "text": "Whisk the flour, milk and lemon zest."
      },
      {
        "id": "202",
        "recipe_id": "12",
        "group_name": "",
        "group_order": "0",
        "sort_order": "1",
        "title": "",
        "instruction_text": "Cook each pancake for 2 minutes a side.",
        "image_id": null,
        "video_url": "",
        "duration": "4",
        "timer_seconds": "240",
        "tip": "",
        "text": "Cook each pancake for 2 minutes a side."
      }
    ],
    "nutrition": null
  }
}
Field Type Meaning
data.id string The new recipe’s id
data.status string Always draft

The copy is titled with (Copy) appended, gets a new unique slug, starts as a draft that is not featured, and starts with no views or ratings. Its categories, cuisines, courses, ingredients, instructions and nutrition are copied; reviews are not.

Errors

Status Code When
404 rest_error No recipe with that id.
500 rest_error The copy could not be written.

Plus the errors every endpoint can return.

Examples

curl -s -X POST "https://your-site.example/wp-json/plugixa-recipe/v1/recipes/12/duplicate" \
  -u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-recipe/v1/recipes/12/duplicate');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => 'admin:' . getenv('WP_APP_PASSWORD'),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const auth = 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`);
const response = await fetch('https://your-site.example/wp-json/plugixa-recipe/v1/recipes/12/duplicate', {
  method: 'POST',
  headers: {
    'Authorization': auth,
  },
});
const { data } = await response.json();

Quick Links

Share