The Hammers scored three second half goals to see off AFC Wimbledon and book their place in the third round of the Carabao Cup.
Wimbledon took a shock early lead through Joe Pigott, but had Rod McDonald sent off and eventually the Hammers' possession told.
Issa Diop, Angelo Ogbonna and Chicharito scored the goals to complete the comeback.