The move by the US Tennis Association (USTA) comes after Sharapova, ranked 148th this week, was rejected for a wildcard spot into the French Open and missed Wimbledon with a thigh injury.
Sharapova tested positive for meldonium at the 2016 Australian Open and was suspended by the International Tennis Federation, a ban that ended in April.
Since then, Sharapova has needed wildcards to get into tournaments, drawing criticism from some fellow professionals.
"Consistent with past practice, a wildcard was provided to a past US champion who needed the wildcard for entry into the main draw. Previous US Open champions who have received US Open main draw wildcards include Martina Hingis, Lleyton Hewitt, Kim Clijsters and Juan Martin del Potro."
More From This Section
Former world number one Sharapova won the 2006 US Open as well as Wimbledon in 2014, the 2008 Australian Open and the 2012 and 2014 French Opens.
"Additionally, Sharapova has volunteered to speak to young tennis players at the USTA national campus about the importance of the tennis anti-doping program and the personal responsibility each player has to comply with the program's requirements," the USTA said.
Sharapova has shaken off criticism from rival players about wildcards and the French Open snub, tweeting after being denied a spot at Roland Garros, "If this is what it takes to rise up again, then I am in it all the way, everyday. No words, games or actions will ever stop me from reaching my own dreams. And I have many."
"I'm sure this is a great moment for her to have an opportunity to be back to a place where she has done so well," ninth-ranked Venus Williams said.
World number six dismissed any notion it would be wrong to give Sharapova a wildcard, saying, "Either way it's not a controversy. I don't have a problem with that."
Sharapova has withdrawn from US Open warm-up tournaments in Toronto and Cincinnati the past two weeks after suffering a left forearm injury at Stanford.
In her first US match since March 2015, Sharapova defeated American Jennifer Brady 6-1, 4-6, 6-0 at Stanford.
"Following the doctor's advice on-site, as a precaution for the US Open, I am unfortunately withdrawing from the tournament with the left forearm injury I sustained in Stanford," Sharapova said.