PITTSBURGH — The San Francisco Giants know what it takes to win this time of year. The Pittsburgh Pirates are still learning.

Madison Bumgarner and Brandon Crawford provided a powerful lesson on the difference during the National League wild-card game.

Bumgarner pitched a four-hitter with 10 strikeouts, Crawford hit the first grand slam by a shortstop in postseason history and the Giants routed the Pirates 8-0 on Wednesday night.

“That’s crazy,” Crawford said. “With all the great shortstops that have played before, that’s pretty special. I’m happy to be able to do it.”

After silencing a black-clad crowd hoping for another Pittsburgh playoff run, San Francisco will face NL East champion Washington in the best-of-five Division Series beginning Friday.

This one fizzled by the middle innings — one night after Kansas City edged Oakland in a thrilling start to baseball’s postseason.

Crawford’s shot over the right-field wall in the fourth inning off Edinson Volquez put the Giants ahead. Bumgarner did the rest as San Francisco won its eighth consecutive postseason game and seventh in a row when facing elimination.

Overpowering one of the NL’s best lineups, Bumgarner walked one and threw 79 of 109 pitches for strikes in his latest stellar October performance. The big left-hander, who allowed only four singles, has thrown 15 scoreless innings in two World Series starts.

“It’s fun,” Bumgarner said. “If you’re not playing, you can be excited and nervous and all that. But if you’re pitching in the game, you’ve got to try to push that all aside and try to make pitches like we did tonight.”

Brandon Belt drove in three runs.

Volquez was trying to cap his remarkable comeback season by sending Pittsburgh to the NLDS for the second straight year, but he couldn’t match Bumgarner.

The right-hander cruised until the fourth, when a pair of singles and a walk loaded the bases with none out. Crawford followed with a drive that kept carrying all the way to the seats above the 21-foot high Roberto Clemente wall to quiet the largest crowd in the 13-year history of PNC Park.

That was more than enough for Bumgarner, who mixed his fastball with a slider the Pirates couldn’t seem to figure out. Pittsburgh, fourth in the majors in extra-base hits this season, rarely hit the ball hard.

“We got outplayed tonight,” second baseman Neil Walker said. “Bumgarner went out there, he did what he wanted to do. He put up the strike zone and he made it tough on us.”

Bumgarner was helped by his defense, too.

Third baseman Pablo Sandoval — all 245 pounds of him — flipped over the railing in front of the Pittsburgh dugout to track down a foul popup off the bat of Russell Martin.

Sandoval landed on his feet, a perfect symbol of San Francisco’s seemingly endless resiliency when the calendar flips to October.

Back in the playoffs after winning the World Series in 2010 and 2012, the Giants are looking to continue their every-other-year success.

Pittsburgh, on the other hand, was unable to duplicate last year’s victory over Cincinnati in the wild-card game that followed a 21-year playoff drought. Playing before raucous crowds at PNC Park, the Pirates pushed St. Louis to a decisive Game 5 before losing their NLDS.

This year, Pittsburgh went 17-9 in September while taking the Cardinals to the final day of the season in an attempt to win the NL Central.

The chase included a decision to start budding ace Gerrit Cole in the regular-season finale in the hopes of catching the Cardinals and avoiding the wild-card game. Cole struck out 12 in a brilliant performance but the Pirates lost, putting Pittsburgh’s hopes for extending its season on Volquez’s excitable shoulders.

The former All-Star navigated three innings in the biggest start of his career before it all unraveled in the fourth.

Sandoval and Hunter Pence opened the inning with singles. Belt walked on a full count to set up Crawford, who sent a 1-2 hanging breaking ball soaring to right. Pittsburgh’s Travis Snider drifted back and turned, expecting it to carom off the wall.

It didn’t, instead landing a couple of rows deep to immediately turn a frenzied atmosphere into a stunned silence save for the whoops coming from the San Francisco dugout, a familiar sound when its season is on the line.

Crawford’s grand slam was the fourth in Giants postseason history.

“The last thing on my mind was probably hitting a home run,” Crawford said. “I was just trying to hit something good enough to get Pablo home, and I figured that would probably be good enough for Madison.”

Shortstop had been the only position — including pitcher — without a slam in postseason play.

San Francisco added on against Pittsburgh’s normally reliable bullpen, and the “Black Out” crowd faded to black, some heading to the exits long before the final out.

“When they got up early on us we were trying to scratch and claw our way back,” Walker said. “He was good from the first pitch until the last pitch.”

TRAINER’S ROOM

Giants: OF Michael Morse was left off the wild-card roster while he recovers from a strained oblique that has sidelined him since Sept. 20. Manager Bruce Bochy said the veteran would be activated “at some point” in the next round.

“It would be nice to have him coming off the bench, but he’s not quite ready,” Bochy said.

UP NEXT

It’s on to Washington for the Giants, where they will face rookie manager Matt Williams and the Nationals. Williams was once a star third baseman for San Francisco.

The Giants went 2-5 against Washington this season, getting outscored 41-30.