Jeremiah 7:29

Cut off thine hair, O Jerusalem, and cast it away, and take up a lamentation on high places; for the LORD hath rejected and forsaken the generation of his wrath.

The verse belongs to the warning of Judah's downfall given after the prophets' appeals went unheeded, when the people gave no response to the messages God sent through the prophet. Jerusalem is called to cut off hair and cast it away and to take up lamentation on the high places and to mourn. The cause of that mourning is that the people rejected God's warnings through idolatry, treachery and shamelessness, including the abominations of Topheth, so the Lord rejected and forsook that rebellious generation of His wrath.

Mere outward form of temple worship is of no avail to the ungodly. The wilful generation will soon be punished by the swift avenger Babylon. The prophet weeps over this desperate state of sin.

The command to cut hair is an instance of God's people cutting hair. Cutting hair or shaving was not prohibited in itself, but was objectionable when it made them resemble idolaters whose grooming marked allegiance to a god or religion.