> For the complete documentation index, see [llms.txt](https://docs.foodcore.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.foodcore.io/ingredients/duplicates.md).

# Fix duplicate ingredients

Duplicate ingredients are one of the most common data quality problems in FoodCore, and they're easy to end up with — especially after importing a spreadsheet or adding ingredients over time without a consistent naming convention. The good news is that FoodCore gives you a straightforward way to find them and merge them so your recipes stay accurate.

## How duplicates happen

Duplicates typically appear in a few situations:

* **Manual entry over time** — someone adds "Plain Flour" in January, then "plain flour" in March, then "Flour (Plain)" in June. Three records, one ingredient.
* **Importing a spreadsheet** — if you import a CSV and FoodCore doesn't match a row to an existing ingredient (perhaps because the name is spelled slightly differently), a new record is created alongside the existing one.
* **Multiple users** — in a team, two people might add the same ingredient independently without realising.

The problem with duplicates is that different recipes may be using different versions of the same ingredient. One recipe might reference the £1.20 per kg flour record; another might reference the outdated £0.95 per kg record. Your cost data becomes unreliable.

## Find your duplicates

The fastest way to spot duplicates is to sort your ingredient list alphabetically by name:

1. Go to **Ingredients**.
2. Use the search bar or sort column to order ingredients by **Name A–Z**.
3. Scan down the list for ingredients that are the same or very similar — different capitalisations, abbreviations, or word orders.
4. You can also use the **filter** options to narrow to a specific category, which makes scanning a shorter list easier.

Alternatively, use the **Duplicates** view if your version of FoodCore shows one — this surfaces pairs of ingredients that the system has identified as likely duplicates based on name similarity.

## Merge duplicate ingredients

Once you've found duplicates you want to combine:

1. **Tick the checkbox** next to each duplicate ingredient you want to merge. Select at least two (the ones you want to combine into one).
2. Click **Merge** in the action bar that appears at the top of the list.
3. FoodCore shows you a side-by-side comparison of the records. For each field — name, category, unit, cost per pack, pack size, allergens, nutrition — **choose which value to keep**.
4. The ingredient you designate as the "winner" becomes the surviving record. The others are deleted.
5. Click **Confirm merge**.

## What happens to recipes after a merge

This is the most important part: **every recipe that was using one of the duplicate ingredients is automatically updated to use the merged (winner) ingredient instead**. You don't need to go into each recipe and re-link the ingredient manually.

FoodCore does this transparently — the recipe's ingredient quantities stay the same, only the ingredient record they point to changes.

## Verify the merge worked

After merging, it's worth spot-checking a recipe you know used one of the duplicates:

1. Go to **Recipes** and open a recipe that contained one of the old duplicate ingredients.
2. Check the **Ingredients tab** — the ingredient should now appear as the merged record (with the name and values you chose as the winner).
3. Click **Recompute** to refresh the recipe's cost based on the merged ingredient's pricing.

If several recipes were affected, run **Recompute All** on your recipe list to refresh costs across the board.

## Tips for avoiding duplicates in future

* **Search before adding** — before creating a new ingredient, type its name in the search bar on the Ingredients page. If something similar already exists, edit that record rather than creating another.
* **Agree on naming conventions with your team** — decide whether you use "Plain Flour", "Flour, Plain", or "Flour (Plain)" and stick to it. Even a short note in your team's process guide helps.
* **Review after every import** — after any CSV or Excel import, run through the ingredient list alphabetically to check for new duplicates before they spread into recipes.

## What's next

* [Import ingredients from a spreadsheet](https://docs.foodcore.io/ingredients/import.md)
* [Recompute recipe costs after changes](https://docs.foodcore.io/recipes/how-costing-works.md)
* [Add an ingredient the right way](https://docs.foodcore.io/ingredients/add-ingredient.md)
* [Set allergens on your ingredients](https://docs.foodcore.io/ingredients/allergens.md)
