The 36-year-old, who won the Madrid Open in 2012 and 2013, returned to the WTA tour in March after giving birth to her first child last September.
Williams, a 23-times grand slam singles champion, was ousted by her sister Venus in her comeback tournament at Indian Wells and last played in her first round defeat by Japan's Naomi Osaka at the Miami Open.

Serena Williams will continue to train as she attempts to work herself back into top shape (Adam Davy/PA)

Image credit: PA Sport

Tennis
'She is a billion-dollar girl' - How Raducanu has the world at her feet
22/09/2021 AT 08:49
"We regret the absence of Serena and we wish her a speedy recovery," tournament director Manolo Santana said in a statement on the Madrid Open website.
"She is one of the great champions of our sport, she has always offered a show to the tournament and we hope to see her again at the Caja Magica in the future."
Poland's Agnieszka Radwanska has also withdrawn from the Madrid Open, which runs from May 7-13, due to a back injury.
Williams missed the first grand slam of the year at the Australian Open in January and could also be ruled out of the French Open, which is held from May 21 to June 10.
Tennis
Opinion: No multiple major winners again, but Barty’s 2021 season should be given more respect
21/09/2021 AT 17:49
US Open
'The younger generation has taken over' - Becker hails 'Dame Emma Raducanu'
16/09/2021 AT 14:32