Starbucks Corp.’s plan to do away with plastic straws by 2020 could not only benefit the environment, but also drive millennial customers through the doors.

The coffee company announced Monday that it will “phase out” plastic straws at its 28,000-plus global stores by 2020, a plan aimed at eliminating more than one billion straws a year. The need for an alternative to plastic straws grew as the sales of cold beverages has risen, up to more than 50% of sales from 37% of sales five years ago.

Straws will be replaced by a lid developed by Emily Alexander, an engineer in global research and development at the company.

The lids are being used for a few drinks including the Draft Nitro in more than 8,000 stores in the U.S. and Canada. Starbucks SBUX, +0.06% says the lids will become standard for all iced drinks except for frappuccinos, which will be served with straws made from paper, compostable plastic, or another sustainable material. Customers can request a straw for other drinks.

Read:New research claims coffee isn’t bad for you but should you drink 8 cups a day?

How millennials are disrupting the financial adviser industry

The lids are available first in Vancouver and Seattle, where single-use plastic straws and utensils were banned from the city’s 5,000 restaurants as of July 1.

“By nature, the straw isn’t recyclable and the lid is, so we feel this decision is more sustainable and more socially responsible,” said Chris Milne, director of packaging sourcing for Starbucks.

Earlier this year, Starbucks committed $10 million to develop a cup that can be composted or recycled.

Starbucks isn’t the only food company taking measures to reduce the number of single-use plastic straws.

McDonald’s Corp. MCD, +0.53% launched a new set of goals earlier this year: by 2025 all restaurants will have packaging, including straws, that are from renewable, recycled, or certified sustainable sources.

“We understand that recycling infrastructure, regulations and consumer behaviors vary from city to city and country to country, but we plan to be part of the solution and help influence powerful change,” a McDonald’s spokesperson told MarketWatch in a statement.

The McDonald’s website goes into further detail about the steps it’s taking to combat climate change.

The effort isn’t only one that will benefit the environment. Experts say it will also drive sales to an important demographic.

See:Jack Link’s to open a second jerky store as millennial taste for meat snacks grows

“It’s a differentiation move in my opinion to satisfy the shifting consumer,” said JoAnn Martin, vice president of retail strategy in North America for JDA Software, a retail and supply chain software company. “Socially conscious retailers resonate with millennials. They value companies that share their beliefs.”

Plastic straws have become the target of environmental efforts to battle climate change, waste, and ocean debris. In April, The Wall Street Journal analyzed the attention being paid to reduce the number of plastic straws handed out at bars, with paper straws becoming a widely used alternative.

Among the companies that stand to take a hit from the move away from plastic straws are Tetra Pak, one of the biggest suppliers of the product, and R&M Drinking Straws. Both are privately held companies.

The food retail industry isn’t the only one addressing the problem. Hyatt Hotels Corp. H, +0.05% also said that straws and picks will only be available upon request starting Sept. 1, 2018, with “eco-friendly” alternatives provided where available.

And the clothing industry is ramping up its sustainability efforts, with Gant launching a line of shirts for me and women earlier this year that contain “upcycled” plastic collected from the ocean.

Also:REI rolls out first-of-its-kind sustainability requirement that will affect every brand in its stores

JDA’s Martin doesn’t think the transition away from plastic straws will be a big supply chain problem for Starbucks since its happening gradually.

But the impact will be great for companies across the food industry, many of which are taking steps to become increasingly eco-friendly.

“Customer experience goes beyond products and loyalty to brands,” she said. “Many companies are seeking ways to connect to their customers and drive a deeper tie. Moves to be philanthropic and socially conscious are important.”

Starbucks competitor Dunkin’ Brands Group Inc. DNKN, +0.45% said in February that it will eliminate foam cups around the world by 2020, replacing them with double-walled paper cups.

The company hasn’t said anything specific about changes to plastic straws, but said it is “constantly evaluating [its] packaging, including plastic straws and stirrers, and continue[s] to explore ways to provide more sustainable products that meet our customers’ expectations of performance.”

Don’t miss:Amazon Prime Day will take a bite out of the food sector as Whole Foods is included

Other companies like Chipotle Mexican Grill Inc. CMG, -1.53% and Olive Garden parent Darden Restaurants Inc. DRI, +8.12% post detailed sustainability reports on their websites.

“Chipotle is evaluating ways to reduce the usage of plastic straws at their restaurants,” the company said in a statement. That includes working with suppliers on a lid that doesn’t require a straw and signs that encourage guests to only take a straw if they need one.

Darden did not respond to MarketWatch’s request for comment.