Cops finally have a lead on the whereabouts of notorious Mexican drug lord “El Chapo’’ — thanks to an incredibly dopey mistake by his son.

Jesus Aldredo Guzman Salazar, 29, tweeted a photo of himself and two other men dining at an outdoor restaurant.

He used a smartphone, but wasn’t smart enough to switch off the phone’s location-tagging function, according to Britain’s Daily Mail newspaper.

It showed the photo was snapped in Costa Rica.

The face of one of the men is completely obscured by a large emoticon; that of the second man only partially so.

But that person bears a strong resemblance to Joaquin “El Chapo’’ Guzman.

And now the elder Guzman, the leader of the Sinaloa cartel who escaped from a maximum-security jail in Mexico in July, is the object of an intense manhunt in the Central American country.

His son has long taunted police with social-media posts that gloat about his father’s escape.