Abdel-Shafi is one of a handful of Zamalek players whose deals expire at the end of the season, with the cash-strapped club desperate to avoid a mass exodus next summer.
"Abdel-Shafi will remain at Zamalek for two more years," the club said in a brief statement on their social media accounts.
The 36-year-old has been one of Zamalek's most consistent performers since he returned to the club in the summer of 2019 after ending a fruitful spell at Saudi Arabia's Ahli.
He missed the first few months of last season due to a shoulder injury but proved instrumental to the Cairo giants' triumphant league campaign when he returned to action.
This season, the left-back position is rotated between him and Ahmed Fattouh, who is part of Egypt's squad for the African Cup of Nations in Cameroon.
Zamalek risk losing several other players though due to their mounting financial problems, including key Moroccan winger Achraf Bencharki and defensive midfielder Tarek Hamed, both of whom will be free to leave in the summer.
(For more sports news and updates, follow Ahram Online Sports on Twitter at @AO_Sports and on Facebook at AhramOnlineSports.)