Can be recited in all paces / shrines when one intends to depart.
Farewell Know that the summary of visitation etiquette is that the visitor leaves when he intends to bid farewell to the place.
So when you intend to depart, stand by the grave and ask Allah's permission to bid farewell then say:
السَّلَامُ عَلَيْكُمَا يَا وَلِيَّيِ اللَّهِ
as-salāmu ‘alaykuma yā walīyyay Allāh
Peace be upon you, O friends of Allah.
أَسْتَوْدِعُكُمَا اللَّهَ وَأَقْرَأُ عَلَيْكُمَا السَّلَامَ
astawdi‘ukumā Allāh wa aqra’u ‘alaykuma as-salām
I entrust you to Allah and pass peace upon you.
آمِنًا بِاللَّهِ وَبِالرَّسُولِ وَمَا جَاءَ بِهِ وَدَلَّ عَلَيْهِ
āminan bi-llāh wa bi-r-rasūl wa mā jā’a bih wa dalla ‘alayh
Secure in faith in Allah, the Prophet, and what he brought and pointed to.
اللَّهُمَّ اجْعَلْنِي مِنَ الشَّاهِدِينَ لَهُمَا بِحَقِّكَ تَعَالَى
Allāhumma ij‘alnī mina sh-shāhidīn lahumā bi-ḥaqqika ta‘ālā
O Allah, make me among witnesses for them by Your right.
وَارْزُقْنِي الْعَوْدَ إِلَيْهِمَا آخِرَ الْعَهْدِ مِنِّي زِيَارَتُهُمَا
wa rzqnī l-‘awda ilayhimā ākhira l-‘ahdi minnī ziyāratuhumā
Grant me to return to visit them as my last covenant.
وَاجْعَلْنِي مِنَ الْمَرْحُومِينَ بِلِقَائِهِمَا
wa ij‘alnī mina l-marḥūmīn biliqā’ihimā
And make me of those who are granted mercy in meeting them.
وَاحْشُرْنِي مَعَهُمَا فِي الزُّمْرَةِ الطَّاهِرَةِ
wa’ḥshurnī ma‘ahumā fī z-zumrati ṭ-ṭāhirah
And gather me with them in the pure group.
وَلِقَاءِ النَّبِيِّ وَآلِهِ وَظِلَّيهِمَا ذُرِّيَّتِهِمَا إِلَى يَوْمِ الرَّحْمَةِ
wa liqā’i n-nabīyi wa ālihi wa ẓillayhimā dhurriyyatihimā ilā yawm ir-raḥmah
And the meeting of the Prophet and his family and their offspring till the Day of Mercy.
يَا أَرْحَمَ الرَّاحِمِينَ
yā arḥama r-rāḥimīn
O Most Merciful of the Merciful.
اللَّهُمَّ لَا تَجْعَلْهُ آخِرَ الْعَهْدِ مِنِّي لِزِيَارَتِهِمَا
Allāhumma lā taj‘alhu ākhira l-‘ahdi minnī lizyāratihimā
O Allah, do not make this my last covenant to visit them.
وَلَا تَجْعَلْنِي مِنَ الْمَحْرُومِينَ مِنْ شَفَاعَتِهِمَا
wa lā taj‘alnī mina l-maḥrūmīn min shafā‘atihimā
Nor make me among those deprived of their intercession.
وَلَا تُخْلِنِي مِنْ صِيَانَتِهِمَا وَلَا تُشْمِتْ بِي عَدُوًّا
wa lā tukhlinī min ṣiyānatihimā wa lā tushmit bī ‘adūwan
Nor abandon me concerning their protection, nor let enemies mock me.
وَلَا تَجْعَلْ لِي فِي مَوْقِفِ الْقِيَامَةِ نَصِيبًا مِنَ النَّارِ
wa lā taj‘al lī fī mawqifi l-qiyāmah naṣīban min an-nār
And do not assign me a share of the fire on the Day of Judgment.
وَلَا تُحْدِثْ نَفْسِي بِخِلَافِ الَّذِي أَحْبَبْتَ
wa lā tuḥdith nafsī bikhilāfi l-ladhī aḥbabta
And do not make my soul contrary to what You love.
وَلَا تُخْرِجْنِي مِنَ الدُّنْيَا إِلَّا عَلَى وِلَايَتِهِمَا وَالاعْتِقَادِ
wa lā tukhrijnī mina d-dunyā illā ‘alā wilāyatihimā wal-i‘tiqād
And do not let me leave this world except on their guardianship and faith.
بِحَقِّهِمَا وَزِدْنِي مَعْرِفَةً بِفَضْلِهِمَا
bi-ḥaqqihimā wa zidnī ma‘rifatan bifadlihīmā
In their right and increase me in knowledge of their virtue.
وَوَفِّقْنِي لِطَاعَتِهِمَا وَاجْعَلْنِي مِنَ الْمُتَّبِعِينَ
wa waffiqnī liṭā‘atihimā wa ij‘alnī mina l-muttabi‘īn
And grant me success in obeying them and make me among their followers.
وَجَنِّبْنِي مَعْصِيَتَهُمَا وَاجْعَلْنِي فِي الْقِيَامَةِ أَمِينًا
wa jannibnī ma‘ṣīatahumā wa ij‘alnī fī l-qiyāmah amīnan
And keep me away from disobeying them, and make me safe on the Day of Judgment.
عَلَى حَوْضِ مُحَمَّدٍ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ الْطَّاهِرِينَ
‘alā ḥawḍi Muḥammad ṣallā llāhu ‘alayhi wa ālihi ṭ-ṭāhirīn
At the basin of Muhammad, peace be upon him and his pure family.
مِنَ الْمُتَوَلِّينَ لَهُمَا وَمِنَ الْمُسَلِّمِينَ لَهُمَا
mina l-mutawallīn lahumā wa mina l-musallimīn lahumā
Among those who are devoted to and submit to them.
وَسَلِّمْ لِي إِيمَانِي وَدِينِي وَتَوْفِيقِي
wa sallim lī īmānī wa dīnī wa tawfīqī
And grant me steadfastness in my faith, religion, and success.
وَثَبِّتْنِي عَلَى طَاعَتِهِمَا وَمَحَبَّةِ أَوْلِيَائِهِمَا
wa thabbitnī ‘alā ṭā‘atihimā wa maḥabbat awliyā’ihimā
And make me firm in obeying them and loving their friends.
وَلَا تُبَاعِدْنِي مِنَ الزِّيَارَةِ
wa lā tubā‘idnī mina z-ziyārah
And do not make me distant from visitation.
وَدُمْ بِذِكْرِكَ وَمَحَبَّتِهِمَا وَالصَّلَوَاتِ عَلَيْهِمَا
wa dum bi dhikrika wa maḥabbatihimā waṣ-ṣalawāt ‘alayhimā
And keep me constant in remembering You, loving them, and sending blessings upon them.
وَأَجِرْنِي فِي الدُّنْيَا وَالْآخِرَةِ بِالفَوْزِ وَالتَّقْوَى
wa ajirnī fī d-dunyā wal-ākhirah bil-fawz wat-taqwā
And reward me in this world and the hereafter with success and piety.
وَالرِّزْقِ وَالْبَرَكَةِ وَالْكَرَامَةِ
wa r-rizq wal-barakah wal-karāmah
And provision, blessing, and honor.
النُّورِ وَالإيمَانِ وَحُسْنِ الإِجَابَةِ
an-nūr wa al-īmān wa ḥusn al-ijābah
The light, faith, and the good answering.
كَأَوْسِبْتِ لِلأَلْبَابِ لِمَعَارِفِهِمْ
ka-awsibti lil-albāb lima‘ārifihim
As the means for understanding their knowledge.
بَعْضُهُمُ الْمُوجِبِينَ طَاعَتَهُمْ
ba‘ḍuhumu l-mūjibīn ṭā‘atahum
Some of them who cause obedience.
وَالرَّاغِبِينَ فِي رَاحَتِهِمْ
wa r-rāghibīn fī rāḥatihim
And those desiring their comfort.
الْمُتَقَرِّبِينَ إِلَيْكَ وَإِلَيْهِمْ
al-mutaqarribīn ilayka wa ilayhim
Those close to You and to them.
يَا أَيُّهَا النَّبِيُّ فِي نَفْسِي وَمَالِي وَأَهْلِي
yā ayyuhā n-nabī fī nafsī wa mālī wa ahli
O Prophet, in myself, my wealth, and my family.
الْقُرْبَاءِ وَإِلَهُهُمْ
al-qurbā’ wa ilahuhum
The relatives and their God.
بنيَّتِهِمْ وَذَوِيهِمْ وَشَفِّعْهُمْ
biniyyatihim wa dhawīhim wa shaffi‘hum
By their intention and those close to them, intercede for them.
بِنُورِكُمْ وَقِسْمِكُمْ
bi-nūrukum wa qismikum
By Your light and Your portion.
وَصَبْرِي وَرُجُوعِي وَحُبِّي وَأَمَلِي
wa ṣabrī wa rujū‘ī wa ḥubbī wa amalī
And my patience, return, love, and hope.
وَارْحَمْنِي فِي شَفَاعَتِهِمْ
wa arḥamnī fī shafā’atihim
And have mercy on me in their intercession.
وَأَدْخِلْنِي فِي جَمَاعَتِهِمْ
wa adkhilnī fī jamā‘atihim
And admit me among their group.
وَأَبْلِغْنِي آمَالَهُمْ
wa ablaghnī āmalahum
And fulfill their hopes through me.
وَاسْعِدْهُمْ حَتَّى أَحْيَيْتَ مَحَبَّتَهُمْ
wa as‘idhum ḥattā aḥyayta maḥabbatahum
And bless them until You revive their love.
وَسَلَامًا وَالسَّلَامُ عَلَيْكُمْ وَرَحْمَةُ اللّهِ وَبَرَكَاتُهُ
wa salāman was-salāmu ‘alaykum wa raḥmatullāh wa barakātuh
And peace. Peace be upon you, and Allah's mercy and blessings.
Short farewell (wida) Ziyarat common at all shrines.
مِنكَ صَلاحُ مَا آمُلُ فِي نَفْسِي وَأَهْلِي
Minka ṣalāḥu mā āmulu fī nafsī wa ahli
From You is the good I hope for in myself and my family.
وَوَلَدِي وَإِخْوَانِي وَمَالِي وَجَمِيعِ مَا أَنْعَمْتَ بِهِ عَلَيَّ
Wa waladī wa ikhwanī wa mālī wa jamī‘i mā an‘amta bihī ‘alayya
And my children, brothers, wealth, and all that You have bestowed upon me.
يَا أَرْحَمَ الرَّاحِمِينَ
Yā arḥama r-rāḥimīn
O Most Merciful of the Merciful.
Text, translation and recitation from Duas.org