Renee Shutters has long worried that food dyes — used in candy like blue M&M’s — were hurting her son, Trenton.

She testified before the Food and Drug Administration, but nothing happened. It wasn’t until she went online, using a petition with the help of the Center for Science in the Public Interest, that her pleas to remove artificial dyes from food seemed to be heard.

Mars, the candy’s maker, is now hinting that it may soon replace at least one of the dyes with an alternative derived from seaweed.

“I’ve really thought about calling them,” Ms. Shutters said about Mars. “I’m not trying to be this horrible person. What I’m really thinking is that this is an opportunity for their company to lead what would be an awesome publicity coup by taking these dyes out of their products.”

While the F.D.A. continues to allow certain dyes to be used in foods, deeming them safe, parents and advocacy groups have been using websites and social media as powerful megaphones to force titans of the food industry to reconsider the ingredients in their foods and the labeling and processing of their products. In several instances in the last year or so, major food companies and fast-food chains have shifted to coloring derived from spices or other plant-based sources, or changed or omitted certain labels from packaging.

Matthew Egol, a partner at Booz & Company, the consulting firm, said that while food companies had benefited from social media to gain rapid insight into trends, data on what products to introduce and which words to use in marketing, they also had been the target of complaints that sometimes become magnified in an online environment.

Mr. Egol said companies were approaching the negative feedback they get with new tools that help them assess the risks posed by consumer criticism. “Instead of relying on a P.R. firm, you have analytical tools to quantify how big an issue it is and how rapidly it’s spreading and how influential the people hollering are,” he said. “Then you can make a decision about how to respond. It happens much more quickly.”

From Cargill’s decision to label packages of its ground beef that contain “pink slime,” or what the industry prefers to call finely textured meat, to PepsiCo’s decision to replace brominated vegetable oil in Gatorade with a natural additive at the behest of a teenager, corporations are increasingly capitulating to consumer demands.

Companies are reluctant to admit a direct connection between the crusades of consumers like Ms. Shutters or Vani Hari, a blogger known as the Food Babe, and their decisions to tweak products, but the link seems clear. More than 140,000 people have signed Ms. Shutters’s petition on petroleum-based food dyes, and dozens have commented on Ms. Hari’s posts about some of the ingredients in items on Chick-fil-A’s menu.

“We’ve always tried to be a customer-focused organization,” said David B. Farmer, vice president for product strategy and development at Chick-fil-A. “What has clearly changed is some of the channels of communications, which wasn’t a factor in the past like it is today. We’ve had to adapt to that.”

Two years ago, Ms. Hari marveled in a blog post about the nearly 100 ingredients in a Chick-fil-A chicken sandwich and took issue with some of them, like MSG, artificial colors and TBHQ, or tertiary butylhydroquinone, which is used as a preservative in many foods.

“TBHQ is a derivative of butane,” she said in a telephone interview. “The F.D.A. says TBHQ cannot exceed 0.02 percent of fats and oils in a product, but consumers who are eating a sandwich that has it plus French fries and other things that also have it in a single meal may be getting more than that.” She followed that post with another, offering a recipe her readers could use to make a chicken sandwich that is a pretty fair imitation of Chick-fil-A’s — but with only 13 ingredients, none of them artificial.

Chick-fil-A eventually responded, inviting Ms. Hari in October 2012 to spend a day at its headquarters in Atlanta, where she discussed her concern about some ingredients as well as larger issues like the use of chicken from animals whose feed contains antibiotics and the potential for labeling products that have genetically engineered components.

“They went out of their way to make sure I got all the info I needed,” Ms. Hari said. “We sat down and put together a road map of my concerns and then laid out how they would start addressing them and what I would prioritize on a white board.”

Image

Trenton Shutters eating candy that has none of the artificial dyes that make him ill.CreditBrendan Bannon for The New York Times

Most important for her was where Chick-fil-A buys its chicken, and her second priority was removing artificial dyes from the company’s products. “That was one of the easiest things for them to get rid of, I thought,” she said.

This month the company told Ms. Hari that it had eliminated the dye Yellow No. 5 from its chicken soup, and reduced sodium in the soup. It is testing a peanut oil that does not contain TBHQ and will start testing sauces and dressings made without high-fructose corn syrup in the coming year.

The company said its decision to address some of Ms. Hari’s concerns was just a step in a long-term effort to improve and enhance its menu to give consumers what they want. “We’ve been working through the menu, starting with the removal of all trans fat between 2006 and 2008, taking high-fructose corn syrup out of bread, some dressings, some ice cream and milk shakes and reducing sodium across the board,” said Jodie Worrell, Chick-fil-A’s nutritionist.

Last year, the company added oatmeal to its yogurt fruit cups, and it offers fruit cups as an alternative to fries on its menu at no extra charge, “even though it’s more expensive,” Ms. Worrell said.

Kraft withstood Ms. Hari’s criticism for its use of petroleum-based dyes in its popular macaroni and cheese. But the company announced quietly last month that it would no longer use Yellow No. 5 and Yellow No. 6 dyes in its Shapes line of macaroni and cheese beginning in 2014.

Kraft is replacing the dyes with colorings derived from spices like turmeric and paprika. It is also adding more whole grain to the Shapes products, which are shaped like cartoon characters, and reducing the sodium and saturated fats they contain.

“Our Shapes products are popular with families,” Lynne Galia, a spokeswoman for Kraft, wrote in an email. “Parents have told us they would like fun mac and cheese varieties with the same great taste but improved nutrition.”

Asked whether the changes were made in response to Ms. Hari’s crusade, Ms. Galia wrote that they were made as part of the company’s continuing efforts to deliver better nutrition in its products. “We’re always listening to consumers,” she wrote. “In this particular case, we’ve been working on the relaunch for quite some time.”

She said that it took about a year and a half to reformulate the products, and that one of the challenges food companies face when confronted by consumers demanding change is getting them to understand how complicated that change can be.

Food companies must work with suppliers to determine what’s possible, then suppliers have to make the new ingredient in bulk. That ingredient is then tried in the recipe, and the recipe goes through tweaks to try to achieve the same viscosity, texture and other attributes contributed by the old ingredient.

“Then it goes to a validation stage, where we might have a sensory panel made up of folks who have trained capabilities and can apply science to determine if we’re matching the original flavor,” Mr. Farmer of Chick-fil-A said. “And then we test it with customers to get their feedback.”

Some changes come at little cost, others force a higher price. When Chick-fil-A changed its salads, for instance, replacing iceberg lettuce with leaf lettuce and adding options like fresh blueberries, it raised the price it charges for them to cover some of the additional costs. “It’s a more expensive product, but we’re selling significantly more salads because that’s what the customer wants,” Mr. Farmer said.

Similarly, Mars had to receive F.D.A. approval to replace FD&C Blue No.1, the petroleum-based dye it uses for blue M&M’s, with a blue dye derived from spirulina, an algae, that is often used in confectionary and chewing gum. “As a company, we continue to explore the use of naturally sourced colors,” Mars said in a statement. “While we do not currently use spirulina extract, its approval is a step toward providing us the option to produce confectionary products made with this naturally sourced color.”

Ms. Shutters said she was happy to hear about the potential new dye. She omitted all foods containing petroleum-based dyes from her son’s diet a few years ago, hoping it would help improve his focus, ease fidgetiness and make him more cooperative in his hockey practice.

“His schoolteacher just about passed out when he went back after the break,” she said. “I’m not kidding you, it was a miracle that we figured it out. I never realized until then how big an impact what you eat can have.”

A version of this article appears in print on , Section B, Page 1 of the New York edition with the headline: Social Media as a Megaphone to Push Food Makers to Change. Order Reprints | Today’s Paper | Subscribe