Williams was broken in her opening service game, hitting the net on three straight points. She didn't put up much resistance in the rest of the first set. But she broke Wozniacki at love in the fifth game of the second and ripped a forehand return winner for another break that put her ahead 4-3.
Wozniacki had no reply as the Dane hit a shot long to go down 2-0 in the decider, and Williams cruised to victory in a matchup of former top-ranked players.
Williams improved her record to 10-0 on clay this season with her third win in the Spanish capital.
"I had a really slow start today. I don't know why, I was just a little sluggish and mentally I was fighting some demons maybe," said Williams, who extended her clay record to 10-0 this season. "I was just like, 'I gotta do better than this.'"