Whoopi Goldberg was ready to leave her job at The View last year but only if she was paid out the millions owed on her contract, RadarOnline.com has learned.

Sources reveal that last summer the 66-year-old was under pressure to walk away from the longtime gig.

As RadarOnline.com previously reported, friends close to Whoopi have been urging her to leave claiming it has caused her too much stress.

An insider said Whoopi was considering leaving The View but wanted to collect on the four-year deal she inked in September 2021 — worth an estimated $8 million a year — whether she’s sitting in the hot seat or not.

“Even with her giant-size ego, she can’t hold off her enemies forever,” said a source at the time.

“She wants a hefty payoff to leave or else she’ll stay and make everyone miserable.”

An insider said her bosses were “considering it.

” The source explained, “Whoopi has three years left on her contract but after her embarrassing blunders the feeling is it might be prudent to replace her.”

Sources said Whoopi had been debating on leaving months after ABC suspended her over her remarks about the holocaust.

During a Hot Topics segment, the host said the Holocaust was “not about race … it’s about man’s inhumanity to other man.”