When the Prophet ﷺ migrated to the city of Yathrib, he changed its name to Madinah instead. Why would one do that to a city that already had a perfectly good name?
Turns out that Yathrib wasn’t a good name at all. Yathrib literally meant “Cursed.” Due to previous outbreaks of malaria and other diseases, people suspected that the city was cursed and referred to it as such.
The Prophet ﷺ always changed names of places – and even people – who were unfairly or negatively labeled. So the “cursed” city instead became known as Taibah – The Pure City, Taaba – The Beautiful City, and Madina-tul-Munawwara – The Illuminated City.
Why did the Prophet sal Allahu alayhi wasallam, when he migrated to the city of Yathrib, change it's name to Madinah?
When the Prophet sal Allahu alayhi wasallam was in the city of Makkah, he said that, I saw in a dream that Allah Subhanahu Wa Ta'ala would command me to migrate to a city full of date palm trees. He said, when I saw this dream, I thought it was Yamama or another city known as Hajar, until Allah Subhanahu Wa Ta'ala commanded me to migrate to the city known as Yathrib Al-Madinah.
The Prophet sal Allahu alayhi wasallam, while he was in Isra' wal Miraj, said that, as I was passing and going on my way to Jerusalem, I saw the city that Allah Subhanahu Wa Ta'ala commanded me that I would migrate to. When he migrated to the city, the city was known as Yathrib. It has a negative meaning and a negative connotation, to the extent that it was known as a diseased city, a disease full of malaria and other sicknesses, to the extent that people called it Yathrib, which meant something that is cursed, and that is why the Prophet sal Allahu alayhi wasallam wanted to change it's name, because many people had an ill-feeling when they came to the city that they would get sick, and some even passed away.
The Prophet sal Allahu alayhi wasallam's own father, Abdullah, and his mother, Aminah, passed away because of this sickness that was in this particular city, and the Prophet sal Allahu alayhi wasallam always had a habit to change names that were negative or had bad connotations to that which were beautiful and had beautiful connotations and descriptions as well. This is why the Prophet sal Allahu alayhi wasallam said that, Allah azza wa Jal commanded that it's name be changed to Al-Madinah and Taybah and Taabah" the Pure, the Beautiful and the Illuminated City of the Prophet sal Allahu alayhi wasallam.