The boundary walls around San Gimignano, as we see it today, dates back to the 13th century. The oldest part was built before the year 1000, but only a few remains of it are still visible. The second city wall was built around 1210 and remodelled by interventions that took place up until 1251. When San Gimignano was stormed by the Florentine Guelphs, the destruction of the walls was ordered. In 1261, having recovered its independence and the Ghibellines had returned to power after the battle of Montaperti, the people of San Gimignano rebuilt the walls even higher and thicker. Large stones from the Pescille quarry were used for its construction.
With the increase in trade, helped by the intense passage of people along the Via Francigena, two villages had formed along the north-south route: that of San Matteo, towards Pisa, and that of San Giovanni, towards Siena, both along a new "via maestra" (main road) that absorbed the walls of Montestaffoli.
Some new gates were added to the older gates of San Matteo, Arco di Goro and Arco dei Becci. Today, the outline of the walls still shows five gates: Porta San Giovanni, Porta Quercecchio, Porta San Matteo, Porta San Jacopo, Porta delle Fonti.
Porta San Giovanni and Porta San Matteo were used by travellers who came from or went to the city of Siena.