Hatton had travelled to South Africa to face the home favourite but was ultimately disappointed.
Van Heerden was comfortable throughout the opening 10 rounds, boxing well to keep the challenger at range.
The 31-year-old from Manchester pushed hard towards the end, though, and rocked his opponent with two strong blows that drew blood from Van Heerden.
The Johannesburg crowd may have feared a shock for a moment, but the title holder regained his composure to see out the last minutes and retain his belt. He won with scores of 118-110, 117-112 and 116-112 in his favour.
Hatton's record is now 52 fights, 43 wins, seven losses and two draws. He has lost two and drawn once in his three world title bouts.