Swiatek tested positive in an out-of-competition sample in August but the International Tennis Integrity Agency (ITIA) accepted it was caused by contamination of her medication melatonin, which was manufactured and sold in Poland.
Swiatek had been taking it for jet lag and sleep issues.
As there was no significant fault or negligence, the ITIA offered her a one-month suspension, which she accepted.
"The player was provisionally suspended from September 22 until October 4, missing three tournaments, which counts towards the sanction, leaving eight days remaining," the ITIA said in a statement on Thursday.
"In addition, the player also forfeits prize money from the Cincinnati Open, the tournament directly following the test."
Swiatek described the ordeal of testing positive as the "worst experience of my life".
"In the last 2.5 months I was subject to strict ITIA proceedings, which confirmed my innocence," Swiatek said on Instagram.
"The only positive doping test in my career, showing unbelievably low level of a banned substance I've never heard about before, put everything I've worked so hard for my entire life into question.
"Both me and my team had to deal with tremendous stress and anxiety. Now everything has been carefully explained, and with a clean slate I can go back to what I love most."
This is the second recent high-profile doping case in tennis, with world No.1 men's player Jannik Sinner having failed two tests for a steroid in March.
He was subsequently cleared in August, right before the start of the US Open, which he went on to win for his second grand slam title of the season.