The former Arsenal midfielder - capped 34 times by England - had not featured for the Hammers at the start of the 2020-21 season after making just 10 appearances in all competitions last term.
In a statement posted on his social media accounts, the 28-year-old revealed his disappointment at the move to his boyhood club failing to work out, having signed a three-year deal in July 2018.
Wilshere also made clear that there are no concerns over his fitness, having been troubled by injuries during his career, and he is excited about what the future holds.
"I can confirm that I have today agreed the termination of my contract with West Ham United," Wilshere wrote.
"When I joined the club in the summer of 2018, I joined with great hopes and expectations and was excited to join the club I'd supported as a young boy.
"Unfortunately, despite all of my best efforts and intentions, it has not worked out as I'd expected. I have been fully fit for a large period of time at the club, including over the course of the last eight months - training hard every day - but unfortunately have not been given the opportunity to play.
"Although I am of course frustrated that I was not able to fully showcase what I am capable of at West Ham, I remain convinced that I can still contribute at the very top of the game.
"I am still incredibly hungry, ambitious and desperate to play football and achieve success. I'm still only 28 and feel fit, strong and ready to play.
"I'm now looking forward to the future and hope to be able to make an announcement about the next stage of my career in due course."