Sofia Vergara won't date someone more than two years younger than her.

The 51-year-old actress - who split from Joe Manganiello, 47, last summer after seven years of marriage - has revealed her boundaries after finding out that musician Bad Bunny, 29, had name checked her in his song 'Monaco'.

During an appearance on 'Watch What Happens Live With Andy Cohen' this week, she was asked if she'd "ever date him", and replied: "Well no, let's not go crazy, let's not go crazy.

"He is younger than my son Manolo. Manolo is 32."

The chat show host asked if that was "the rule" now she's single, adding: "They can't be younger than your son?"

She said: "To me, they can't be younger than 50, I'm 51. Okay, 49. [she laughed] I'm intelligent."

The 'Modern Family' star recently revealed she and her ex split because they had different outlooks on having a family of their own.

She told Spanish newspaper El Pais: “My marriage broke up because my husband was younger; he wanted to have kids, and I didn’t want to be an old mom. I feel it’s not fair to the baby.”

Sofia stressed she has “respect” for anyone who wants to have babies later in life but said it was “not for (her) anymore”.

Sofia, who has 32-year-old son Manolo Gonzalez Vergara with her first husband, Joe Gonzalez, added: “I had a son at 19, who is now 32, and I’m ready to be a grandmother, not a mother.

“I’m almost in menopause; it’s the natural way of things.

“When my son becomes a dad, let him bring the baby to me for a while and then I’ll give it back to him and go on with my life; that’s what I have to do.”