Turn new recipe posts into shoppable Instacart links

By General Input

Every morning, your latest recipes get a one-click Instacart shopping link added right under the recipe card, and your back catalog gets filled in too.

Integrations

  • Instacart
  • WordPress
  • Slack Bot

Type

Agentic Task

Categories

  • Marketing
  • Operations

Every morning at 7am, find my newly published recipe posts on WordPress, turn each one into a shoppable Instacart page, and link that page back into the post automatically.

Use WordPress List Posts to pull published posts in my Recipes category from the last 24 hours. In the same run, also sweep older posts in the Recipes category that do not yet contain an Instacart link, so the archive gets backfilled over time. Work the backfill in small batches, no more than five older posts per run, so the site is never hammered. Before touching any post, check the body for an existing instacart.com link and skip the post if one is already there. That check is what keeps repeat runs from double-inserting, so apply it to the new posts and the backfill sweep alike.

For each post that passes the check, read the post body and extract the ingredient list with quantities and units, plus the numbered instructions. Ingredients may live in a recipe card, a bulleted list, or plain paragraphs, so parse whatever formatting the post actually uses instead of assuming a fixed template. Also grab the featured image URL, the author name, the number of servings, and the cooking time when the post states them.

Normalize the ingredients before sending them to Instacart. Instacart accepts only these units: each, lb, oz, g, kg, ml, L, cup, tbsp, tsp, gallon. Convert messy blog units into that set. Turn fractional quantities like "1 1/2 cups" into a decimal quantity of 1.5 with the unit cup, map spelled-out units like "tablespoon" and "teaspoons" onto tbsp and tsp, and fall back to a quantity of 1 with the unit each when an ingredient carries no meaningful measurement. Leave pantry staples off the shoppable list entirely, including water, salt, and pepper, so readers are not asked to buy things they already have.

Call Instacart Create Recipe Page with the recipe title, image URL, author, servings, cooking time, the normalized ingredients with their measurements, and the numbered instructions. Set the link to expire in 365 days, the maximum, since these posts are evergreen. The response comes back with a products_link_url. Reuse that stored URL rather than regenerating a page for a post that already has one.

Use WordPress Update a Post to insert a "Shop these ingredients on Instacart" link into the post body directly beneath the recipe card, or directly beneath the ingredient list when the post has no recipe card. Preserve the rest of the body exactly as it was and change nothing else about the post.

After each post is updated, send a message to my content channel in Slack with the post title and the new Instacart link. If a post has no ingredient list that can be parsed, or Instacart rejects the ingredients, skip that post and call it out in the Slack message rather than writing a broken link into the site.

Related prompts

Explore more prompts
A brand asset library your marketing team actually searchesTurn Mailjet email clicks into ranked HubSpot follow-upsClean out the Looker dashboards and Looks nobody opensLiveKit live operations console for room moderationWake up dormant Keap leads with a researched reasonLiveChat coverage board for planning next week's shiftsPhone routing control panel for LiveKit voice agentsLinkedIn Ads budget pacing dashboard for every client accountGive your team Looker numbers without buying more seatsPause marketing emails to escalated customers, then restore them