After starting strongly, Hammers took the lead when Darren Brady swung in a free-kick from the left that was flicked into the net by Stokes after 20 minutes.
After creating two or three good chances without managing to score again before the break, Hammers eventually secured a two-goal cushion 10 minutes into the second half when schoolboy striker Ephrain cut in from the right and finished well.
Just three minutes later, it was 3-0, and this time the goal came from an even younger source. Central defender James Tomkins - who only turned 14 in March and still has two seasons of schoolboy football to play - had replaced the injured Liam White after just 15 minutes, and rounded off an impressive performance with an excellent header from Ephrain's corner.
Bristol City pulled one back late on, but Stokes restored the three-goal advantage in the final minute when he pounced on a rebound to claim his fourth goal in three matches.
Said Kevin Keen afterwards: "It was an excellent result and an excellent performance. We played some good football and the boys bounced back well after last week's defeat at Sheffield United.
"That was a tough game and a bit of an eye-opener for some of the younger lads, but they responded well today and fully deserved the win.
"We lost Liam White with a shin injury early on, but young James Tomkins came on and impressed, scoring a goal and defending very well.
"Overall, I am delighted - we were very good all over the field."
Team: Reed, Young, Norval, White (Tomkins 15), Andrews, Davidson, Singh, Cowley (Cumberworth 70), Brady, Stokes, Ephrain (Allen 80). Subs unused: Welsh, Yao.
by Danny Francis