Turn new recipe posts into shoppable Instacart links
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.
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.
Additional information
What does this prompt do?
- Checks your blog each morning for recipes published in the last day, and works through older recipes that do not have a shopping link yet.
- Reads the ingredient list and the steps straight out of your post, so it works with whatever recipe format you already use.
- Creates an Instacart page where readers pick their own nearby store and add every ingredient to a cart in one click.
- Adds a "Shop these ingredients on Instacart" link under your recipe and posts the title and link to your content channel in Slack.
What do I need to use this?
- A WordPress blog you can log in to, with your recipes filed under a category such as Recipes
- An Instacart developer account that can create shoppable recipe pages
- A Slack workspace and the channel where you want the daily updates to land
- Recipes written with a clear ingredient list and numbered steps in the body of the post
How can I customize it?
- Change the 7am run time, or run it more than once a day if you publish often.
- Point it at a different category, or at several, if your recipes are not all filed under Recipes.
- Reword the button text, or add your own pantry staples to the skip list beyond water, salt, and pepper.
FAQs
Will this work with my recipe card plugin?
What happens if it runs twice on the same recipe?
Will it ask my readers to buy water, salt, and pepper?
How far back does it go through my old recipes?
Do readers have to shop at one specific store?
Related templates
Every weekday, find every unpaid JobNimbus invoice, email each customer one reminder that gets firmer as it ages, and post a receivables summary to Slack.
Every weekday at 7am, your active courses are checked for missing work, silent logins, and slipping grades, with a ranked list sent to your advising channel.
Every hour, find the tickets closest to breaching, leave a nudge on each one, and post a ranked at-risk list to your support channel.
Every weekday afternoon, each student who is behind gets a warm, personal message in their Canvas inbox listing exactly what they owe.
Every Monday at 8am, see exactly which assignments have work waiting, sorted worst first, posted to Slack and logged to a spreadsheet.
Every weekday morning we compare your password vault against your HR records and suspend access for anyone who has already left.
Turn every recipe you publish into a shoppable link.
Set it up once and every new post, plus your whole back catalog, gets a one-click ingredient cart without you touching the HTML.