Celtic boss Ronny Deila says keeping his best players will take priority over acquisitions in the transfer window.
Chelsea striker Fernando Torres is understood to be set for a return to Atletico Madrid, according to Sky sources.
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.