The Yankees are losing their mojo.

Long the team America loved — and loved to hate — the Bronx Bombers over the last couple of years have not just stumbled on the field but are also losing fans across the country, according to several baseball metrics.

The Yanks are no longer a top attendance draw on the road and have seen their YES Network ratings tumble. They haven’t had a single player’s jersey crack the Top 20 in sales since Derek Jeter retired in 2014.

Even worse, the crosstown rival Mets — fresh off winning the 2015 National League pennant and with a roster studded with young pitching stars and the slugger Yoenis Cespedes — have passed the Yanks as an attraction on the road, in jersey sales and in local TV ratings.

“When the Mets started winning last July, we saw an explosion in fan avidity,” said Woody Thompson, who specializes in baseball sponsorships at sports market firm Octagon. “There were so many latent followers who wanted to let their freak flags fly — and then the Mets gave them a reason to do so.”

On the YES network, Yankees viewership is down 10 percent this year, to an average of 233,403 per game, compared to last season.

On May 2, Yanks GM Brian Cashman even admitted, “I’m getting tired of watching this.”

From their peak, YES ratings of Yanks’ games have dropped 50 percent.

From 2002, when YES was launched, through 2011, the Yanks consistently drew an average of more than 400,000 viewers a game.

Mets’ viewership on SNY, meanwhile, is up 16 percent over last year, to 280,588 — leapfrogging over the Yanks.

Thompson predicted the Mets’s SNY ratings will benefit from the halo effect of last season’s World Series appearance for several years.

To be sure, YES viewership has been cut a bit because of Comcast blocking the network during a fee dispute. But the ratings have declined in four of the past five years — with only Jeter’s going-away tour providing a bit of an increase in 2014.

When fans across the country vote with their wallets and buy jerseys of their favorite players, the Yanks are missing their swagger.

While Jeter was a perennial top seller over his 20-year career, no Yankee has cracked the list since the future Hall of Famer retired.

Meanwhile, three Mets — Matt Harvey, David Wright and Jacob deGrom — made the top 20 list of bestselling MLB jerseys last year.

As recently as 2011, it was reversed — no Met made the list while four Yanks did: Derek Jeter, Alex Rodriguez, Robinson Cano and Mariano Rivera.

Perhaps most telling about the Yanks losing their national firepower is that the team now ranks 17th in road attendance, at 28,824 through June 4.

For the six seasons ended in 2014, the Yanks were No. 1 in road attendance four times and finished second and third the other two years. Last year they sank to No. 10 before sliding seven positions in 2016.

Again, the slide has coincided with a rise on popularity for the Mets. The Amazins are No. 10 in road attendance this season.

While the schedule could be responsible for some of the decline — games against too many poor-drawing teams stacked early in the season — the overall trend is undeniable.