وَإِذْ قَالَت طَّائِفَةٌ مِّنْهُمْ يَا أَهْلَ يَثْرِبَ لَا مُقَامَ لَكُمْ فَارْجِعُوا ۚ وَيَسْتَأْذِنُ فَرِيقٌ مِّنْهُمُ النَّبِيَّ يَقُولُونَ إِنَّ بُيُوتَنَا عَوْرَةٌ وَمَا هِيَ بِعَوْرَةٍ ۖ إِن يُرِيدُونَ إِلَّا فِرَارًا
And when a party of them said: "O people of Yathrib! There is no stand (possible) for you (against the enemy attack!) Therefore go back!" And a band of them ask for permission of the Prophet ( SAW) saying: "Truly, our homes lie open (to the enemy)." And they lay not open. They but wished to flee.
Why is the word “Yathrib” used at [Ahzab 33:13] whereas in other places it’s always “Madinah” (e.g. Munafiqoon 63:8)?
Even more intriguingly, this surah is Madinan (revealed in Madinah), and the word Madinah is used later on in the same surah at verse 60 [Ahzab 33:60]!
One of the wisdoms for doing so (and Allah knows best) is that Madinah is a nickname (short for Madinat-un-Nabi – The City of the Prophet) given after Hijrah [emigration of the Prophet], and so the use of the the term “Madinah” by people signifies allegiance to the Prophet (sal Allah alaihi wasalam).
Now if we look closely at Ahzab 33:13, we see that it captures a part of the saying of the munafiqoon [hypocrites] at the time – they’re exposing their hypocrisy in the battle of/ Khandaq/Ahzab by calling on the people of Yathrib (not Madinah!) to give up and go home!
These were those who had lost their claim to power in the city as a result of Hijrah [emigration of Prophet Muhammad & his companions), and are using old associations to rouse the people, thereby making their nifaaq [hypocrisy] clear.
So the use of Yathrib is not a mistake or slip-up as people might assume, it’s actually perfectly positioned to suit the context of the situation.