Nik Rajkovic / news@whmi.com

Walgreens is planning to close around 1,200 locations, as the drugstore chain and its rivals struggle to define their role for U.S. shoppers who no longer look to them first for convenience.

Drugstores that once snapped up prime retail spots across the country are in retreat. They've been battered by shrinking prescription reimbursement, persistent theft, rising costs and consumers who have strayed to online retailers or competitors with better prices.

Walgreens' announcement Tuesday comes as rival CVS Health wraps up a three-year plan to close 900 stores and Rite Aid emerges from bankruptcy, whittled down to about 1,300 locations.