"If you don't know where your onions are from, don't eat, serve, or sell them or any food prepared with them," the CDC told restaurants.
For consumers they said, "If you can't tell where your onions are from, don't eat them. Throw them away."
The CDC said no deaths have been reported as a result of the outbreak.
Infections have been reported in several states including Alaska, Alabama, Arizona, Arkansas, California, Colorado, Connecticut, Delaware, Florida, Georgia, Hawaii, Idaho, Illinois, Indiana, Iowa, Kansas, Kentucky, Kentucky, Maine, Maryland, Massachusetts, Michigan, Minnesota, Mississippi, Missouri, Montana, Nebraska, Nevada, New Hampshire, New Jersey, New Mexico, New York, North Carolina, North Dakota, Ohio, Oregon, Pennsylvania, Rhode Island, South Carolina, South Dakota, Tennessee, Texas, Utah, Virginia, Washington, West Virginia, Wisconsin and Wyoming.
As of Wednesday, August 18, the CDC reported 15 people had been infected in Pennsylvania, two in New Jersey, and two in Delaware.
The Food and Drug Administration has warned consumers not to eat onions from Thomson International Inc. The advice applies to red, white, yellow, and sweet onions.
RELATED: Thomson International Complete List of Recalled Products
Some of the onions were sold at stores including Walmart, Trader Joe's, Kroger, Fred Meyer, Publix, Giant Eagle, Food Lion, and H-E-B, under a variety of brand names, the CDC said.
Besides Thomson International, Inc., other brand names that may be on labels include: Thomson Premium, TLC Thomson International, Tender Loving Care, El Competitor, Pacific Gold, Hartley's Best, Onions 52, Majestic, Imperial Fresh, Kroger, Utah Onions, and Food Lion.
RELATED: FDA: Red onions linked to salmonella outbreak
Trader Joe's recalled Pacific Gold red onions by Progressive Produce, LLC. They were sold only in Arizona, California, Nevada, and Utah stores.
Walmart recalled red, white, yellow, and sweet yellow onions by Thomson International.
Several companies have recalled onions and foods made with recalled onions like chicken salad, macaroni salad, fajita stir-fry, pizza and diced raw onions, including Taylor Farms and Giant Eagle.
The CDC said people should check their homes for the recalled products and throw away the affected items.
"Do not eat them or try to cook the onions or other food to make it safe," the CDC said.
When ordering from a restaurant or shopping for food, the CDC said people should check with the restaurant or grocery store to make sure they are not serving or selling recalled onions from Thomson International, Inc., or any foods prepared with recalled onions, including foods such as salads, sandwiches, tacos, salsas, and dips.
"If they don't know where their onions are from, don't buy the product," the CDC said.
The recall began on August 1 when Thomson International, Inc., voluntarily recalled red, yellow, white, and sweet yellow onions because they may be contaminated with salmonella.
Giant Eagle recalled onions and foods made with recalled onions sold in stores across Pennsylvania, Ohio, West Virginia, Indiana and Maryland.
Publix recalled onions sold in bulk at stores in Alabama, Georgia, North Carolina, South Carolina, Tennessee, and Virginia.
On August 5, the United States Department of Agriculture's Food Safety and Inspection Service (USDA-FSIS) issued a public health alert for products made with recalled onions.
On August 6, Taylor Farms issued a recall of foods that were made from recalled onions.
On August 12, cheese dips and spreads were recalled from the following stores: Kroger, Kroger Mid-Atlantic, Kroger Delta Division, Fry's Food Stores, Fred Meyer, and Smith's.
The CDC said there may be additional recalls related to this outbreak.
A complete list of affected states is on the CDC's website.
Signs of Salmonella
Signs of salmonella infection include diarrhea, fever and stomach cramps between six hours and six days after exposure to the bacteria. Those under age 5, those over 65 and people with weakened immune systems are more likely to experience severe illness.
In some cases, the infection can spread from the intestines to other parts of the body and require hospitalization.
The CDC is urging anyone with symptoms of salmonella poisoning to contact a doctor, write down what they ate the week before they became sick, report the illness to the health department and communicate with health investigators about their illness.
CNN contributed to this report.