WASHINGTON — President Obama poked fun at Hillary Clinton’s lack of appeal among young people Saturday night, joking at the annual White House press corps dinner that Mrs. Clinton was like an aging relative who cannot figure out how to use Facebook.

“Did you get my poke? Is it on my wall?” he said, imagining Mrs. Clinton trying to use the popular social media site. “I’m not sure I’m using this right. Love, Aunt Hillary.”

Mr. Obama also needled Mrs. Clinton for paid speeches she gave for Goldman Sachs. He noted that if his comedy routine, during his final appearance at the White House Correspondents’ Association dinner, was successful, he could earn “serious Tubmans” — a nod to Harriet Tubman, the American abolitionist whose image will be printed on future $20 bills.

He referred to Senator Bernie Sanders, who was in the audience, as “comrade,” a reference to his political status as a democratic socialist.