A weakened ability to effectively resist distraction is a potential basis for reduced working memory capacity (WMC) associated with healthy aging. Exploiting data from 29,631 users of a smartphone game, we show a distinction between distractor-filtering at working memory (WM) encoding and during WM maintenance in younger adults. We also show that, as age increases, WM performance is compromised more by distractors presented during WM maintenance than distractors presented during encoding. However, with increasing age, the ability to exclude distraction at encoding is a better predictor of WMC in the absence of distraction. A significantly greater contribution of distractor filtering at encoding represents a potential compensation for reduced WMC in older age.