Boris Johnson was told not to shake hands with dignitaries including the Queen over coronavirus fears and said the move sent a "subliminal cue" about the importance of hygiene.
Guests at the Commonwealth Service – the last appearance by the Duke and Duchess of Sussex as senior royals – adopted a range of greetings to get around the handshake ban.
The Prince of Wales opted for a namaste as he was introduced to guests at Westminster Abbey, while Harry bumped elbows with musician Craig David and Meghan decided to hug the 7 Days singer.
The Queen and other senior royals were following the protocol the Abbey has been operating under during the past few weeks.
Mr Johnson was pictured at the event clasping hands with heavyweight boxing champion Anthony Joshua despite the advice.
The Prime Minister said: "We were all given an instruction not to shake hands and there's a good reason for not shaking hands, which is that the behavioural psychologists say that if you don't shake somebody's hand then that sends an important message to them about the importance of washing your hands.
"So there's a subliminal cue there to everybody to wash your hands, which is, I think I'm right in saying... far more important."
Handshaking was "a matter for individual choice" but was much less important than washing, he added.
Mr Johnson, who attended the event with his pregnant fiancee Carrie Symonds, has previously said he was "shaking hands with everybody" despite the concerns about the spread of the virus.
When the Duke of Cambridge arrived at the service he joked with Lord Howell, chairman of the council of Commonwealth Societies, about the protocol to avoid spreading germs.
"It's very odd not shaking hands, I try my best to hold my hands like that," William said laughing as he clasped them together and held them against his waist.
And when he chatted to Joshua, who is 6ft 6ins tall, the royal avoided shaking hands and quipped: "I feel you'd crush mine."
A spokeswoman for the Abbey said: "Westminster Abbey is acutely aware of the risks posed by the spread of novel coronavirus.
"In recent weeks we have advised members of our congregations to avoid shaking hands."