Rangers boss Stuart McCall says he feels sorry for Gael Bigirimana, but admits he should never have been signed.
Chris Gunter will stay at Reading, after the club took up the option to extend his deal by another year.
The 32-year-old transferred to the Hammers from Marseille for £2million in 2012, and made six appearances for the club before being loaned to Rennes for the remainder of the 2012/13 season.
Diarra made a further eight appearances for West Ham the following season, rarely in a first team instance.
He last played for the East End outfit in the Capital One Cup 3-0 loss to Manchester City in January.
Confirming the decision, West Ham stated on their official website: "West Ham United can confirm that the club and Alou Diarra have reached a mutual agreement to terminate the midfielder's contract and registration with immediate effect.
“Diarra joined the Hammers in August 2012 but has found first-team opportunities limited and his release means he is now free to pursue opportunities elsewhere.
“West Ham United would like to thank Alou for his efforts at the club and wish him well for his future career.”
West Ham start their 2014/15 campaign at home to London rivals Tottenham Hotspur on 16th August.