Why Allergen Filtering and Nutritional Transparency Matter More Than Ever
A customer with a severe peanut allergy stares at your online menu, trying to figure out which dishes are safe. If they can’t find that information within seconds, they’ll close the tab and order from a competitor who makes it obvious. That scenario plays out thousands of times a day across restaurant websites — and it represents both a safety issue and a missed revenue opportunity.
The numbers tell the story clearly. According to FARE (Food Allergy Research & Education), roughly 33 million Americans live with food allergies, and that number continues to climb. A 2023 survey by the National Restaurant Association found that 86% of adults say they’re more likely to visit a restaurant that clearly labels allergens on its menu. In the EU, Regulation (EU) No 1169/2011 (commonly called the FIC regulation) mandates that all food businesses — including online ordering platforms — declare the presence of 14 major allergens. In the United States, the FDA’s menu labeling requirements under the Affordable Care Act require calorie disclosure for chains with 20+ locations, and several states are pushing for broader rules that cover smaller operations too.
Beyond legal compliance, there’s a powerful business case. Transparency builds trust. When diners see that you’ve taken the time to tag allergens and display nutritional breakdowns, they feel confident ordering more — and they come back. Restaurants that add dietary filters to their online menus frequently report higher average order values because customers who previously avoided ordering online now feel safe doing so.
If you’re running a WooCommerce-based restaurant site — especially with a restaurant ordering plugin like FoodMaster — you already have the foundation. WooCommerce’s flexible product architecture makes it surprisingly well-suited for building allergen filters and nutritional calculators. Let’s walk through exactly how to do it.
Setting Up Dynamic Allergen Filters on Your WooCommerce Menu Page
The first step is structuring your allergen data properly in WordPress. You have two main approaches: custom taxonomies and product attributes. Both work, but they serve slightly different purposes.
Option 1: Custom Product Taxonomy
Registering a custom taxonomy called something like allergen gives you the most flexibility. You can create terms for each major allergen — gluten, tree nuts, peanuts, dairy, soy, shellfish, crustaceans, eggs, sesame, sulfites, mustard, celery, lupin, and mollusks (the full EU-14 list). A custom taxonomy lets you query and filter products natively through WordPress, and it integrates cleanly with most filtering plugins.
You’d register the taxonomy in your theme’s functions.php or a custom plugin using register_taxonomy(), attaching it to the product post type. Then, when editing each menu item in WooCommerce, you simply check the relevant allergen boxes — just like assigning categories.
Option 2: WooCommerce Product Attributes
If you prefer staying within WooCommerce’s native system, create a global attribute called “Allergens” under Products → Attributes. Add each allergen as a term. Then assign the relevant allergens to each product. This approach works well with WooCommerce’s built-in layered navigation widget and is compatible with most AJAX filtering solutions out of the box.
Building the Front-End Filter
The goal is to let customers click a button labeled “Nut-Free” or “Dairy-Free” and instantly see only safe items — without a full page reload. Here’s how to approach this:
- FacetWP is a popular premium plugin that creates AJAX-powered faceted filters for any WordPress query. It supports WooCommerce product attributes and custom taxonomies, making it a solid choice if you want a no-code solution.
- Custom JavaScript approach: If your menu is already rendered on a single page (common with restaurant ordering setups), you can add data attributes to each menu item’s HTML container — like
data-allergens="gluten,dairy,eggs"— and write a lightweight JS function that toggles visibility based on which filter buttons are active. This avoids any server requests entirely and feels instantaneous. - FoodMaster’s product display system already renders menu items in a structured layout. You can extend it by hooking into the product loop and appending allergen data attributes, then layering your filter UI on top.
One critical UX decision: should the filter hide items containing the selected allergen, or show only items free of it? The safer and more intuitive pattern is exclusion — the customer selects “I’m allergic to nuts,” and all items containing nuts disappear. Label your filter buttons clearly: “Hide items with: Gluten | Nuts | Dairy | Soy | Shellfish | Eggs.”
[IMAGE: Screenshot of a WooCommerce restaurant menu page with allergen filter buttons at the top, showing color-coded allergen icons next to each menu item and a few items grayed out after selecting the nut-free filter]
Adding a Per-Item Nutritional Calculator with Calories, Macros, and Serving Sizes
Once allergens are handled, the next layer of transparency is nutritional data. Customers increasingly want to see calories, protein, carbohydrates, fat, sodium, and fiber before they order — especially those following specific diets like keto, macro counting, or medically supervised meal plans.
Storing Nutritional Data
The cleanest approach is using Advanced Custom Fields (ACF) to create a field group attached to WooCommerce products. Create number fields for each nutrient:
- Calories (kcal)
- Protein (g)
- Total Carbohydrates (g)
- Total Fat (g)
- Saturated Fat (g)
- Sodium (mg)
- Fiber (g)
- Sugar (g)
- Serving Size (text field, e.g., “1 burger, 250g”)
If you don’t want to use ACF, WooCommerce’s native custom fields (post meta) work just as well — they’re just less user-friendly for staff who need to update values regularly. Store each nutrient as a separate meta key like _nutrition_calories, _nutrition_protein, etc.
Displaying Nutritional Info on the Product Page
Rather than cluttering the product page, use an expandable accordion panel or a tabbed section. Hook into woocommerce_single_product_summary or woocommerce_after_single_product_summary to render a “Nutrition Facts” panel. Style it to resemble the familiar FDA nutrition label format — customers already know how to read that layout, so you reduce cognitive load.
A simple PHP template snippet pulls each ACF field and outputs it in a structured table. Wrap the whole thing in a
HTML element for native expand/collapse behavior without any JavaScript dependency.
Building a Running Cart Nutritional Total
This is where things get genuinely useful. As customers add items to their cart, a small widget — either in the sidebar, the sticky cart bar, or the cart page itself — shows cumulative nutritional totals for their entire order.
The implementation strategy: output each cart item’s nutritional data as hidden data attributes or a JSON object in the cart markup. Then, a JavaScript function iterates through all cart items, multiplies values by quantity, and sums them into a running total displayed in a fixed-position panel. When WooCommerce updates the cart via AJAX (after quantity changes or item removals), your script recalculates automatically by listening to the updated_cart_totals jQuery event that WooCommerce fires natively.
Handling Combo Meals, Toppings, and Modifiers in Your Nutritional Calculations
Here’s where most restaurant nutritional calculators fall apart. A “Build Your Own Burger” with 15 possible toppings, three bun options, and two sizes creates hundreds of nutritional combinations. You can’t pre-calculate all of them — you need real-time math.
Attaching Nutritional Data to Add-Ons and Variations
If you’re using WooCommerce product variations (e.g., Small / Medium / Large), each variation already has its own product ID and meta fields. Store separate nutritional values for each variation. A small pizza at 800 calories and a large at 1,400 calories should be tracked independently.
For product add-ons and extras — like toppings, sides, and sauce packets — the approach depends on your add-on system. FoodMaster’s built-in product options and extras system lets you define add-ons directly within each product. You can extend these by storing nutritional metadata for each add-on option using custom fields or a structured data array in the product’s meta.
The data structure might look like this for a single add-on:
- Extra Cheese: +110 kcal, +7g protein, +9g fat, +1g carbs
- Avocado: +80 kcal, +1g protein, +7g fat, +4g carbs
- Bacon (2 strips): +90 kcal, +6g protein, +7g fat, +0g carbs
Real-Time Front-End Calculation
On the single product page, embed each add-on’s nutritional values as data-* attributes on the corresponding checkbox or radio button. When a customer checks “Extra Cheese,” a JavaScript event listener fires, reads the nutritional data from that element, and adds it to the base item’s totals displayed on the page.
Keep the JavaScript lightweight — no frameworks needed. A vanilla JS function that listens for change events on all add-on inputs, collects the active selections, sums the values, and updates a DOM element showing the current item’s total nutrition. The whole script can be under 2KB minified.
For the cart-level totals, pass the final calculated nutritional values (base + selected add-ons) as hidden form fields when the product is added to the cart. Store them in WooCommerce’s cart item data array using the woocommerce_add_cart_item_data filter. This way, the cart page has everything it needs to display accurate per-item and order-wide nutritional summaries.
[IMAGE: A product page for a customizable bowl showing base nutritional facts that update in real time as a customer selects toppings, with a sidebar panel displaying the running order total for calories, protein, carbs, and fat]
Designing the Front-End Experience: Icons, Badges, and Accessible Layouts
Functional data is useless if customers can’t parse it quickly. The visual presentation of allergen and dietary information directly impacts whether people actually use it.
Dietary Badges and Allergen Icons
Use color-coded badges for positive dietary labels: a green badge for “Vegan,” a blue badge for “Keto-Friendly,” an orange badge for “Gluten-Free,” and a purple badge for “Halal.” Keep badge colors consistent across your entire menu so customers develop visual recognition quickly.
For allergen warnings, use universally recognized icons rather than text alone. The EU’s standard allergen icon set (a wheat stalk for gluten, a fish for seafood, a milk bottle for dairy, etc.) is widely understood and works across language barriers. Several free SVG icon sets exist specifically for food allergens — search for “food allergen icon set SVG” and you’ll find options from design communities that are licensed for commercial use.
Place allergen icons directly beneath each menu item’s name and price. Don’t hide them behind a hover state or a click — they need to be visible at a glance, especially on mobile where hover doesn’t exist.
WCAG Accessibility Compliance
Allergen information is safety-critical, which makes accessibility non-negotiable. Follow these requirements:
- Every allergen icon must have an
altattribute oraria-labelthat reads the allergen name (e.g.,aria-label="Contains peanuts"). - Color-coded badges must not rely on color alone — include text labels within each badge so colorblind users can read them.
- Filter buttons should be keyboard-navigable and announce their state to screen readers using
aria-pressed="true/false". - Nutritional data tables need proper
headers so screen readers can associate values with their labels. - Maintain a minimum 4.5:1 contrast ratio between badge text and background colors per WCAG 2.1 AA standards.
Mobile-Responsive Filter Layout
On phones, a horizontal row of filter buttons works well — use a scrollable flex container so all allergen filters are accessible without wrapping into multiple rows. Sticky positioning keeps the filter bar visible as customers scroll through the menu. Keep touch targets at least 44×44 pixels per Apple’s Human Interface Guidelines to prevent mis-taps.
The nutritional summary panel should collapse into a floating button on mobile (like a small “Nutrition: 1,240 kcal” pill at the bottom of the screen) that expands to full detail on tap. This preserves screen real estate while keeping the information one tap away.
Testing, Maintaining Accuracy, and Keeping Nutritional Data Up to Date
Launching your allergen filter and nutritional calculator is only half the battle. Keeping the data accurate over time is what separates a trustworthy system from a liability.
QA Testing Checklist
Before going live, run through this verification process:
- Cross-browser testing: Verify AJAX filters and JavaScript calculations work in Chrome, Firefox, Safari, and Edge. Safari on iOS is particularly finicky with certain JavaScript event listeners — test on a real iPhone, not just a simulator.
- Filter accuracy: Manually check at least 20 menu items. Select each allergen filter individually and confirm that every hidden item genuinely contains that allergen, and no safe items disappear incorrectly.
- Nutritional math: Add a known combination of items and add-ons to the cart. Calculate the expected totals by hand and compare them to what the cart displays. Check that quantity changes multiply correctly.
- Screen reader audit: Navigate the entire menu and filter system using VoiceOver (Mac/iOS) or NVDA (Windows). Every allergen label, badge, and nutritional value should be announced clearly.
- Mobile stress test: Order a full meal on a phone using only one thumb. If any filter or nutritional panel is hard to reach or read, redesign it.
Workflow for Ongoing Updates
Recipes change. A supplier swaps an ingredient. A new seasonal dish launches. You need a system that makes updates painless for non-technical staff.
Create a simple spreadsheet template (Google Sheets works well for collaborative access) where the kitchen manager logs each dish’s allergens and nutritional values. Use WooCommerce’s native CSV import/export to bulk-update product meta fields. Map your spreadsheet columns to the custom field keys (
_nutrition_calories,_nutrition_protein, etc.), and you can update hundreds of items in minutes.If you’re using FoodMaster to manage your WooCommerce restaurant menu, your products are standard WooCommerce products — meaning any CSV import tool or bulk-edit plugin that works with WooCommerce will work with your menu items seamlessly.
Set a quarterly review calendar. Every three months, the kitchen manager reviews the spreadsheet against current recipes, flags any changes, and triggers a CSV re-import. This cadence catches most recipe modifications before they become a problem.
The Legal Disclaimer
No matter how careful you are, add a visible disclaimer. Something like: “Nutritional values are estimates based on standard recipes and serving sizes. Actual values may vary. Please inform our staff of any severe allergies before ordering.” Place this at the top of your menu page and at checkout. It’s not a substitute for accuracy, but it’s a necessary layer of legal protection that every major restaurant chain includes.
Launch Readiness Checklist
- All menu items have allergen taxonomies/attributes assigned
- Nutritional data is populated for every product, variation, and add-on
- AJAX filters work without page reload on desktop and mobile
- Cart nutritional totals update correctly when items are added, removed, or modified
- All icons and badges have proper accessibility labels
- Legal disclaimer is visible on the menu page and checkout
- CSV import/export workflow is documented for staff
- Quarterly review dates are scheduled in the team calendar
Building allergen filters and nutritional calculators into your WooCommerce restaurant menu isn’t just a nice-to-have feature — it’s a competitive advantage that protects your customers, keeps you compliant with evolving regulations, and genuinely increases order confidence. The technical lift is moderate, the tools are accessible, and the payoff in customer trust and repeat orders makes every hour of setup time worth it. Start with allergen tagging (it’s the most safety-critical piece), layer in nutritional data once your workflow is solid, and iterate on the front-end experience based on real customer feedback.
Tags:
Related Articles
FoodMaster (formerly WooFood)How to Build a Custom Restaurant Menu with Allergen Filters, Nutritional Info, and Dietary Labels in WooCommerce: Vegan, Gluten-Free, Keto, and Halal Tags for a Better Customer Experience (Complete Guide)
Why Allergen Information and Dietary Labels Matter for Your Restaurant Website A customer with a severe peanut allergy lands on your restaurant’s online menu. There’s no allergen information anywhere. They leave — and they’re never coming back. That lost sale is just the tip of the iceberg. Without clear dietary labeling, you’re losing revenue, risking […]April 16, 2026FoodMaster (formerly WooFood)How to Set Up Time Slot-Based Ordering for Your WooCommerce Restaurant: Configurable Pickup and Delivery Time Slots, Slot Capacity Limits, and Preventing Order Overload During Peak Hours (Complete Guide)
Why Time Slot-Based Ordering Is Essential for Restaurant Websites Picture this: it’s Friday evening, and your online ordering system just accepted 47 orders in the span of 20 minutes. Your kitchen crew can realistically handle 15 orders per half hour. The result? Delivery times balloon from 30 minutes to over 90, customers start calling to […]April 15, 2026FoodMaster (formerly WooFood)How to Set Up a Catering and Large Group Order System on Your WooCommerce Restaurant Website: Custom Menus, Minimum Order Requirements, Scheduled Delivery Windows, and Tiered Pricing for Events and Corporate Orders (Complete Guide)
Why Your Restaurant Needs a Dedicated Catering Order System Online Catering revenue in the United States reached an estimated $66.5 billion in 2023 according to the Catering Industry Association, and a significant portion of that spend is shifting online. Corporate clients, event planners, and families organizing celebrations increasingly expect to browse menus, customize orders, and […]April 14, 2026