The state-run Anadolu Agency said the six were detained late on Saturday, days after videos posted on social media reportedly showed them shouting expletives against Mr Erdogan.
The news agency said they were later charged with "insulting state elders" and that police were searching for other suspects.
Insulting the president is a crime punishable by up to four years in prison. Mr Erdogan has filed close to 2,000 lawsuits against people, including school children, for insulting him.
As a goodwill gesture, he dropped the cases following a failed military coup in 2016. But many more cases have been filed since then.
Sunday’s election poses the biggest ballot box challenge to Mr Erdogan and his Islamist-rooted AK Party since they swept to power more than a decade and a half ago.
The elections will also usher in a powerful new executive presidency long sought by Mr Erdogan and backed by a small majority of Turks in a 2017 referendum. Critics say it will further erode democracy in the NATO member state and entrench one-man rule.
Mr Erdogan, the most popular but also divisive leader in modern Turkish history, moved the elections forward from November 2019, arguing the new powers would better enable him to tackle the nation's mounting economic problems - the lira has lost 20 per cent against the dollar this year - and deal with Kurdish rebels in southeast Turkey and in neighbouring Iraq and Syria.
But he reckoned without Muharrem Ince, the presidential candidate of the secularist Republican People's Party (CHP), whose feisty performance at campaign rallies has galvanized Turkey's long-demoralised and divided opposition.
Addressing a rally in Istanbul on Saturday attended by hundreds of thousands of people, Mr Ince promised to reverse what he and opposition parties see as a swing towards authoritarian rule under Mr Erdogan in the country of 81 million people.
"If Erdogan wins, your phones will continue to be listened to ... Fear will continue to reign ... If Ince wins, the courts will be independent," said Mr Ince, adding he would lift Turkey's state of emergency within 48 hours of being elected.
Turkey has been under emergency rule - which restricts some personal freedoms and allows the government to bypass parliament with emergency decrees - for nearly two years following an abortive military coup in July 2016.
Mr Erdogan blamed the coup on his former ally, U.S.-based Muslim cleric Fethullah Gulen, and has waged a sweeping crackdown on the preacher's followers in Turkey. The United Nations say some 160,000 people have been detained and nearly as many more, including teachers, judges and soldiers, sacked.
The president's critics, including the European Union which Turkey still nominally aspires to join, say Mr Erdogan has used the crackdown to stifle dissent. Few newspapers or other media openly criticise the government and he has received far more election coverage than other presidential candidates.
Mr Erdogan, who defends his tough measures as essential for national security, told his supporters at rallies on Saturday that if re-elected he would press ahead with more of the big infrastructure projects that have helped turn Turkey into one of the world's fastest-growing economies during his time in office.
Polls show Mr Erdogan falling short of a first-round victory in the presidential race but he would be expected to win a run-off on July 8, while his AK Party could lose its parliamentary majority, possibly heralding increased tensions between president and parliament.
Other presidential candidates include Selahattin Demirtas, leader of the pro-Kurdish Peoples' Democratic Party (HDP), who is currently in jail on terrorism-related charges that he denies.
In a final appeal for votes in a video clip from his high security prison, Mr Demirtas said: "If the HDP fails to get into parliament, all Turkey will lose. Backing the HDP means supporting democracy."
Join our commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies