The Republican presidential nominee regularly plays the song before and after his speeches, including at the Republican National Convention in July.
However, Hayes’ family have sued Trump’s campaign, saying that it repeatedly ignored requests to stop using the song, made famous by soul duo Sam and Dave in 1966.
The temporary ruling, by Judge Thomas Thrash in Georgia, means the campaign is banned from playing it again until the court case is settled.
However, the judge did not grant a request to order Trump’s campaign to take down recordings of past events in which it had used the song.
Hayes’ son, Isaac Hayes III, welcomed the ruling, saying that his father, who died in 2008, would not have endorsed the former President.