Most were built as tombs for the country 's Pharaohs and their consorts during the Old and Middle Kingdom periods .
Most were built during the Old and Middle Kingdom periods .