Praise be to Allah.
It is better to give obligatory zakaah openly and announce it, so that others will follow one’s example, lest one be thought badly of and some people think that this person is not paying zakaah.
But if a person fears that he will be showing off, or he fears that it may cause some hurt and embarrassment to the poor person, then it better to give it in secret.
It is possible to combine both interests, by giving some zakaah openly and giving some secretly, according to circumstances.
Al-Nawawi (may Allah have mercy on him) said: It is better, in the case of zakaah, to give it openly, so that others will see it and do likewise, and lest one be thought badly of. This is the same as obligatory prayer: it is mustahabb to do it openly. It is only mustahabb to conceal in the case of naafil prayers and fasts. End quote from al-Majmoo‘, 6/228.
Al-Mardaawi said in al-Insaaf (3/200): It is mustahabb to pay zakaah openly in all cases, according to the correct view. End quote.
Ibn Battaal said in his commentary on Saheeh al-Bukhaari, 3/420: There is no difference of opinion among the leading scholars: giving obligatory charity openly is better than doing it secretly, and giving voluntary charity in secret is better than giving it openly… The same applies to all kinds of obligatory and naafil actions. Sufyaan said: “‘but if you conceal them and give them to the poor, that is better for you” [al-Baqarah 2:271], except zakaah. This view is like consensus. End quote.
It says in al-Mawsoo‘ah al-Fiqhiyyah (23/301), concerning matters to which attention should be paid when giving zakaah:
Paying zakaah should be done openly and announced. … al-Tabari said: The scholars are agreed that doing obligatory acts openly is better. End quote.
With regard to the verse in which Allah says (interpretation of the meaning): “If you disclose your Sadaqaat (almsgiving), it is well; but if you conceal them and give them to the poor, that is better for you” [al-Baqarah 2:271], this has to do with voluntary charity, and is like prayer: offering voluntary prayers at home is better, and offering obligatory prayers in the mosque with the congregation is better. End quote.
And Allah knows best.