Elford-Alliyu, who joined the club in January, made just seven substitute appearances during an unsuccessful spell, while Cooper spent the second part of the season on loan at Portsmouth.
Barker told the club's official website: "Lateef didn't get the opportunities he perhaps deserved because of the form of our other strikers. I have worked with him before and he was a model professional during his time here.
"He is a talented player and I think he will get fixed up with another club but I have told him if he doesn't get sorted that he can come back here for pre-season training with us.
"Shaun had a few problems with injury during his time with us but going on loan to Portsmouth did him good and hopefully he can get fixed up there."
The duo will both depart at the end of June.