It was first mentioned in writing before 1250 AD. In 1265 it received its municipal rights and served as the capital of Dithmarschen, a peasant republic with Allies in the Hanseatic league dating from 1468. The city was sacked in 1500 AD when King John of the Kalmar Union attempted to conquer the republic. His forces were routed by a force with poor arms and inferior numbers in the Battle of Hemmingstedt. In 1559, the republic was conquered. The city lost its municipal rights again in 1598 and would not regain them until 1870. It was county town until 1970 of the district Süderdithmarschen. After a district reform Süderdithmarschen and Norderdithmarschen merged to Dithmarschen and Meldorf lost the capitalship to the town of Heide.
The St. John´s Church (St.-Johannis-Kirche), also called Meldorfer Dom, is the largest church in Dithmarschen, the most important medieval church building at the North Sea coast in Schleswig-Holstein and has a neogothic style.