
Does Joshua 6:21 indicate that God commanded children to be sacrificed?
Joshua 6:21 does not say that children were sacrificed, only that everyone was devoted to God. The phrase is “from youth to old age.” It occurs only here, and in Gen 19:4 and Esther 3:13, two places that do not refer to God’s command. In fact, Genesis 19:4 cannot imply this because it has to do with a sexual crime perpetrated by the inhabitants of Sodom. In Joshua it does not refer to children because Jericho was a fort which, other than Rahab and her family, had no noncombatants. The expression, like “from man to woman,” that occurs alongside it, is a way of saying everyone, not requiring that children or other noncombatants be involved. The same is true for “from youth to old age.” The two statements emphasize everyone in the fort, but do not require that noncombatants be involved. See further:
Richard S. Hess, “The Jericho and Ai of the Book of Joshua,” pp. 33-46 in R. S. Hess, G. A. Klingbeil and P. J. Ray Jr. eds., Critical Issues in Early Israelite History (Bulletin for Biblical Research Supplement 3; Winona Lake: Eisenbrauns, 2008), especially pp. 38-39.
The related discussion on the child sacrifice of Jephthah’s daughter in the questions is here.