Donald Trump did not make it to his much-boycotted Miss USA pageant this year. As The Washington Post’s Emily Yahr reported, his remarks about undocumented immigrants — among them, “they’re rapists” — overshadowed a competition in which a Mexican American was one of the strongest competitors.

This had to hurt. Though Trump is more known for his real-estate business and casinos, he waged a hard-fought entrepreneurial battle to made the pageant a moneymaker — and a PR war to keep it in the national spotlight even as similar events such as Miss America looked more and more like the products of a bygone age.

”What I do is successful because of the aesthetics,” Trump told the New York Times in 1999. For him, putting real estate in the spotlight wasn’t different from putting women in the spotlight.

”People love my buildings and my pageants,” he said.

Trump bought the pageant’s parent company, the Miss Universe Organization, in 1996 for $10 million. Trump’s wife Marla Maples hosted the competition in 1996 and 1997; its ratings were in the toilet. In 1974, the show had attracted more than 35 million viewers — in 2002, that number was barely above 8 million.

What was the problem? In an era when Miss America ratings were also languishing, Trump could have blamed his poor results on a 20th century product trying to thrive on 21st century television. He could have blamed feminism — long the bugaboo of beauty pageants. Instead, he stood by his product, and blamed CBS, which aired Miss USA.

“They were always putting it against the top-rated programs on television,” Trump told The Washington Post in 2002. “It was on against the [season finale] of ‘Friends’; four years ago it was the final episode of ‘Seinfeld.’ I told them I’m tired of being on against the final episode of the year on the number one show of the year.”

Taking his Miss Universe and Miss USA belles to NBC, the Donald stood by the quality of his product. The pageants worked — the pageants would always work — “because the women were so beautiful,” he said in 2002. This was not high-concept entertainment.

“You don’t have to spend money on sets, all you need is a beautiful curtain and the girls,” he said, singling out Miss Russia for praise. “They’re unbelievable. All 10 [finalists] were unbelievable. Guys turned [to the channel] for two seconds and then they couldn’t turn back to the basketball game.”

At NBC, Trump and his ladies thrived.

“With each passing year our ratings continue to get better because of the beautiful and intelligent women who participate in our competitions,” Trump declared in 2007.

These were high-class dames, the argument went: “Organizers say the Miss Universe contest carefully selects women who are intelligent, well-mannered and cultured, and dispute the notion that beauty queens are clueless about international issues,” as the Associated Press put it in 2007.

“We do change with the times,” Paula M. Shugart, president of the Miss Universe Organization, said at the time. “It really opens doors for people. It’s nice for us to pick somebody who is not known, give them a shot and change their life forever.”

Trump also made coronations — and, in at least one case, redemption — part of the pageants’ allure. What had been a contest started to look more and more like a reality show.

In 2006, for example, Trump declined to dethrone Miss USA pageant winner Tara Conner after she tested positive for cocaine.

“She left a small town in Kentucky, and she was telling me that she got caught up in the whirlwind of New York,” Trump said. “It’s a story that has happened many times before to many women and to many men who came to the Big Apple. They wanted their slice of the Big Apple, and they found out it wasn’t so easy.”

The merciful Donald forgave.

“I’ve always been a believer in second chances,” he said. “Tara is going to be given a second chance.” Conner, in tears: “You’ll never know what this means to me, and I swear I will not let you down.”

When Rosie O’Donnell of “The View” criticized Trump for the move, he didn’t pull punches. This was personal.

“Rosie O’Donnell is disgusting, I mean both inside and out,” Trump said. “… Take a look at her, she’s a slob. She talks like a truck driver. … Her show failed when it was a talk show, she failed on that.”

He added: “Probably I’ll sue her because it would be fun. I’d like to take some money out of her fat-ass pockets.”

When a contestant called the show “rigged” in 2012, Trump came out swinging — and won a $5 million judgment.

“We cannot allow a disgruntled contestant to make false and reckless statements which are damaging to many people who have devoted their hearts and souls to the Miss Universe, Miss USA and Miss Teen USA pageant systems,” he said.

Now, with Univision running as he continues to disparage immigrants, Trump is fighting a legal war, suing the network for breach of contract.

But he’s doing it in the name of the women.

“We have 50 of the most lovely women you’ve ever seen right now in Louisiana, and they have been abandoned by NBC and abandoned by Univision,” Trump said earlier this month. He added: “They have been crushed.”