Miguel Pallardo and James Keatings scored in the opening 12 minutes to set up the win before Jamie Walker and Callum Paterson added to the tally after Greig Spence had netted for Alloa.
Hearts started the match in style when Morgaro Gomis turned inside from the left flank and laid the ball in front of Pallardo (5) who strode forward to unleash a drive from 30 yards into the top corner.
Alloa were opened up again 90 seconds later as Osman Sow played a weighted pass in front of Jamie Walker but he sliced his shot wide from inside the penalty area.
The home side almost levelled though when Liam Buchanan threaded a pass into the box for Stephen Simmons and he placed his shot wide of the advancing Neil Alexander only to be denied by the inside of the post.
Having survived that scare Hearts doubled their lead as Sow took a pass from Pallardo and used his strength to hold off a defender before flicking the ball to Keatings to turn his marker inside-out and dispatch a low drive past the diving Craig McDowall.
The Alloa keeper picked up a back pass two minutes before the break and from the resulting free-kick Keatings rolled the ball to Sow, but he blasted over the bar.
Alloa pulled a goal back on 61 minutes when Mark Docherty swung a cross in from the left and Greig Spence headed home from six yards.
And Ben Gordon hooked a shot narrowly wide after Alexander punched the ball out of his penalty area at a free-kick.
But Hearts restored their two-goal advantage when Walker (66) pounced on a slack pass from Simmons and strode into the box the place his shot between the keeper and the post.
McDowall did well to tip a swerving shot from Billy King over the bar after the Hearts substitute turned and drilled the ball towards the top corner from 20 yards.
But two minutes later Paterson rose on the six-yard line to power his header into the corner of the net from a King corner.