SAN FRANCISCO — Trevor Williams and two relievers combined on a six-hitter, and the Pittsburgh Pirates blanked the Giants 4-0 on Saturday night.

Josh Bell homered for the second time in three days. Elias Diaz added two hits for the Pirates after coming in as an injury replacement for Francisco Cervelli.

The start of the game was delayed for a ceremony honoring home run king Barry Bonds, who became the 10th player in Giants history to have his jersey retired. Several of his former teammates and managers, including Dusty Baker and Jim Leyland, were on hand.

Buster Posey and Evan Longoria had two hits apiece for San Francisco.

The Giants have lost nine of their past 11 home games.

Williams had been scheduled to pitch a day earlier, but manager Clint Hurdle went with Clay Holmes to give the rest of the rotation extra rest.

It worked just fine.

Williams (10-8) allowed five hits and walked one in seven innings. The right-hander has allowed two runs over his last 29 innings — a 0.62 ERA.

Williams has been the starter in seven of the Pirates’ 13 shutouts this season.

Blach allowed four runs over four innings in his first start since May 27.

NOTES: Giants first baseman Brandon Belt (hyperextended knee) began a rehab assignment with Triple-A Sacramento.