> 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/maintenance-and-best-practices/clean-duplicates.md).

# Clean up duplicate ingredients

Duplicate ingredients are one of the most common data quality problems in FoodCore — and one of the easiest to miss, because everything keeps working. Recipes still calculate, labels still export. But underneath the surface, one recipe is using "Plain Flour" at £1.20/kg with gluten set to "contains", while another is using "plain flour" at £0.00 with no allergens set at all.

That's a problem. This guide explains how to find duplicates and merge them cleanly.

***

## Why duplicates happen

FoodCore doesn't prevent you from creating two ingredients with similar names. Duplicates typically appear when:

* **You import a CSV from a supplier or another tool** — the import doesn't always recognise that "Caster Sugar" already exists in your system and creates a second entry
* **Two team members add the same ingredient manually** — one adds "Whole Milk" and another later adds "whole milk (full fat)"
* **You rename an ingredient** and the original isn't deleted — now both names exist
* **Autocomplete was ignored** — someone started typing and pressed Enter too quickly, creating a new ingredient instead of selecting the existing one

The result is the same in every case: some recipes use version A with correct data, others use version B with different (often incomplete) data. Costs and allergen information diverge silently.

***

## How to find duplicates

1. Go to **Ingredients**
2. **Sort by Name** — this brings near-identical names next to each other
3. Scroll through the list looking for pairs like:
   * "Plain Flour" / "plain flour"
   * "Butter (Unsalted)" / "Unsalted Butter"
   * "Whole Milk" / "whole milk (full fat)"
   * Any ingredient with a blank cost next to one with a real cost

Pay particular attention to ingredients with a cost of £0.00 or with no allergens set — these are often the "stale" duplicate that slipped in through an import.

***

## How to merge duplicates

Once you've found a pair:

1. **Select both ingredients** using the checkboxes in the ingredient list
2. Click **Merge** — FoodCore will show you both records side by side
3. **Choose the "winner" values** for each field:
   * **Name** — pick the cleaner, more consistent name you want to use going forward
   * **Cost per pack and pack size** — pick whichever has the correct, up-to-date purchasing data
   * **Allergens** — pick the accurately set allergen status; if one is blank and one is set, always choose the set one (and double-check it's correct)
   * **Unit** — make sure this matches how the ingredient is used in your recipes
4. **Confirm the merge** — FoodCore will update every recipe that referenced the duplicate to point to the merged ingredient

The duplicate entry is removed. All recipes now use a single consistent ingredient record.

***

## After merging — verify your recipes

After each merge, spot-check at least one recipe that previously used the duplicate ingredient:

1. Open the recipe in the recipe editor
2. Find the ingredient that was just merged
3. Confirm the cost per unit and allergen status look correct
4. **Recompute the recipe** to refresh the totals

If the cost changes significantly after recomputing, it's a sign the duplicate had incorrect purchasing data. Check the merged ingredient's pack size and cost again.

***

## Preventing duplicates going forward

* **Always use the autocomplete** when adding ingredients to a recipe — if the ingredient appears in the dropdown, select it rather than typing a new name
* **Review the import preview carefully** before confirming a CSV import — FoodCore flags potential conflicts; use the skip or merge option for any detected matches
* **Agree on a naming convention** with your team — for example, always capitalise ingredient names, always include the qualifier in brackets ("Butter (Unsalted)") — consistency makes duplicates obvious

***

## What's next

* [Import ingredients from a CSV](https://docs.foodcore.io/ingredients/import.md)
* [Find and merge duplicate ingredients](https://docs.foodcore.io/ingredients/duplicates.md)
* [Run your weekly data checks](https://docs.foodcore.io/maintenance-and-best-practices/weekly-checks.md)
