Yes, the Awliya must hide their miracles. Which means they must not seek to show them to people. However, this does not mean that a Karamah cannot inadvertently take place in the presence of others, as alluded to by Imam al-Sulami below.
كُلَّمَا دَخَلَ عَلَيْهَا زَكَرِيَّا الْمِحْرَابَ وَجَدَ عِنْدَهَا رِزْقًا قَالَ يَامَرْيَمُ أَنَّى لَكِ هَذَا قَالَتْ هُوَ مِنْ عِنْدِ اللَّهِ إِنَّ اللَّهَ يَرْزُقُ مَنْ يَشَاءُ بِغَيْرِ حِسَابٍ
Every time Zakariyah entered upon her at the Mihrab (her prayer area), he found sustenance with her. He said O Maryam, where did you get this from. She said, it is from Allah (Most High), indeed Allah grants sustenance to whomsoever He wishes without limit. (Surah Ali Imraan, 37).
The concept of Karamaat, which are miracles that occur for pious people who are not prophets, is well established and agreed upon amongst the scholars of Ahl Sunnah. This is due to the numerous evidences found in the Holy Quran and Sunnah, the Ayah above is an example of one such miracle related to Sayidah Maryam .
However, there are significant differences between a Karaamah and a Mujizah, miracle of a Prophet, which many people are ignorant of and therefore they go astray, and lead others astray regarding this issue.
من الفرق بين المعجزات والكرامات أن الأنبياء عليهم الصلاة والسلام مأمورن بإظهارها والولي يجب عليه سترها وإخفاؤها والنبي يدعي ويقطع القول به والولي لا يدعيها ولا يقطع بكرامته لجواز أن يكون ذلك مكرا
Amongst the differences between (prophetic) miracles and Karamaat, is the Prophets, peace and blessings be upon them, have been commanded to make them apparent. Whereas it is obligatory for the Wali to veil and hide them. The Prophet calls to it and it is a matter of certainty. Whereas a Wali does not call to it, and they are not confirmed as Karamaat because of the possibility that it could be deception. (Imam al-Nawawi, Bustaan al-Arifeen, p63).
Imam al-Nawawi explains in the Nass (text) above, that there are multiple differences between a Karaamah and a Mujizah. Amongst those differences is the fact that a Wali is supposed to hide the Karaamah. This point is emphasised by many other classical scholars too.
«كَمَا فَرَضَ اللَّهُ عَلَى الْأَنْبِيَاءِ إِظْهَارَ الْآيَاتِ وَالْمُعْجِزَاتِ لِيُؤْمِنُوا بِهَا كَذَلِكَ فَرَضَ عَلَى الْأَوْلِيَاءِ كِتْمَانَ الْكَرَامَاتِ حَتَّى لَا يَفْتُنُوا بِهَا»
Just as Allah (Most High) made it obligatory for the Prophets to make their signs and miracles apparent, so that people may believe in them. He (Most High) made it obligatory upon the Awliyaa to conceal their Karamaat, so that they do not cause Fitnah by them. (Imam Abu Nu’aym, Hulyatul Awliyaa, Vol. 10, p34).
من أظهر كراماته فَهُوَ مُدع وَمن ظَهرت عَلَيْهِ الكرامات فَهُوَ ولي
Whoever makes his Karamaat (miracles) apparent is an imposter, and whoever’s Karamaat become apparent is a Wali. (Imam al-Sulami, Tabaqaat al-Sufiyah, p415).
In the Nass above Imam al-Sulami differentiates between a person who displays his (claimed) miracles and the one who does not. Rather, they inadvertently occur in the presence of others.
Despite these strongly worded warnings by classical scholars, many people continue to claim miracles and have their students spread them amongst the masses. This has not only lead to widespread misguidance but it has also resulted in abundant abuse. People must return to the correct teachings of Islam to close this door of Fitnah.
The subject of Karamat and Awliyaa is something people speak about often, but unfortunately very few people actually study it. They are unaware of the limits of Karamaat, the differences between them and Mujizaat (prophetic miracles), and other related issues. Likewise, they are unaware issues related to the Awliyah. Which Awliyaa are confirmed and which ones are speculative? Is it permitted to be definitive regarding a particular person being a Wali?
And Allah (Most High) Knows Best.
– Answered by Shaykh Noorud-deen (21.06.2021)
Do we believe in Karamaat of the Awliyaa?
Do Awliyaa know the unseen?
Is there a difference between Karaamah and Mu’jizah?
See also (video):