Sam Allardyceâ€™s side had the perfect start when Matthew Jarvis headed West Ham into a third minute lead from a Kevin Nolan cross.
The home side then conceded their 13th goal of the season just before the break when Ricardo Vaz Te doubled the Hammers lead taking advantage of keeper Julio Cesarâ€™s fumble.
The visitorâ€™s looked to be coasting at this stage particularly as the home side where booed off at half-time.
The Hammers where struggling at this stage but when Samba Diakite was sent off with 16 minutes remaining QPRâ€™s chance of a snatching an equaliser disappeared and West Ham held on to claim the three points.
Referee: Mark Clattenburg
Venue: Loftus Road
QPR scorers: Taarabt 57
West Ham scorers: M Jarvis 3, Vaz Te 35
Yellow cards: Jaaskelainen (WHU), Reid (WHU), McCartney (WHU), Collins (WHU), Nolan (WHU), Noble (WHU), Diame (WHU), Cole (WHU), Taarabt (QPR)
Red card: Diakite (QPR)