The Wales international, who joined West Ham as a teenager and made his first-team debut in 2008, has been released after making 121 appearances in all competitions for the London club.
The 25-year-old said: "The time has come for an end to my West Ham United career. What a roller coaster it has been - I have experienced plenty of ups and downs during my nine-year spell at West Ham!
"I hope I'm remembered as someone who gave his all in every game. Even when things weren't going well, I always tried my best to have a positive impact, not just on pitch, but also off the pitch and around the training ground.
"I must thank the medical staff at West Ham. They have stuck with me through everything and have been fantastic throughout. The moody days, the down days, the rainy days, I have experienced every moment alongside some of the best medical guys I have ever had the privilege of working with.
"As I move forward with my own career, I would like to take this opportunity to thank the fans once more. You have a fantastic set up, great staff and some wonderful players. As you move closer to the Olympic Stadium I wish you lots of luck."
For the big stories and the banter follow us on Twitter: @tribalfootball