His 39-year-old mother and a 45-year-old man, both from the Grange Park area of Blackpool, Lancashire, have been accused of making the boy live in the converted outhouse, which police described as a "cell".
He is alleged to have lived there between January 1, 2010, and January 25 2011.
The two adults have been charged with ill-treating a child and neglecting a child.
The woman appeared at Blackpool Magistrates' Court court dressed in jeans and boots. Her partner wore jeans, a shirt and a jumper.
Neither defendant entered a plea to the charges.
An order banning the identification of the boy, who is now in the care of the local authority social services department, was made by the court.
Prosecutor Martine Connah said the case was not suitable for dealing with at a magistrates' court.
The couple were bailed to February 29 for the committal of their case to crown court.
Magistrates were told that the boy was found living in in what police described as a cell - an old converted outhouse formerly used to store coal.
The house is a post second world war semi and originally would have had coal fires in the lounge and dining rooms.
A neighbour of the couple said: "This is a close knit community but I know nothing about this."How terrible!