Praise be to Allah.
Ruling on witr prayer
Witr prayer is Sunnah muakkadah (a confirmed sunnah) according to the majority of scholars, and some of the fuqaha regarded it as obligatory.
Why witr is not obligatory
The fact that witr prayer is not obligatory is indicated by the hadith narrated by al-Bukhari (1891) and Muslim (11) from Talhah ibn ‘Ubayd-Allah (may Allah be pleased with him) who said: A man came to the Messenger of Allah (peace and blessings of Allah be upon him) and said: “O Messenger of Allah, what prayers has Allah enjoined on me?” He said: “The five prayers, unless you do anything voluntarily.” The version narrated by Muslim says: “Five prayers every day and night.” He said: “Do I have to do anything else?’ He said, “No, unless you do it voluntarily.”
“This indicates that Witr prayer is not obligatory.”
Al-Hafiz said in al-Fath:
“This indicates that no prayers during the day and night are obligatory apart from the five prayers; this is contrary to the view of those who say that Witr or the two Sunnah rak’ahs of Fajr are obligatory.”
Hadiths about witr prayer
However, it is the most confirmed Sunnah and was enjoined by the Prophet (peace and blessings of Allah be upon him) in more than one hadith.
Muslim (754) narrated from Abu Sa’id (may Allah be pleased with him) that the Prophet (peace and blessings of Allah be upon him) said: “Perform Witr before morning comes.”
Abu Dawud (1416) narrated that ‘Ali (may Allah be pleased with him) said: The Messenger of Allah (peace and blessings of Allah be upon him) said: “O people of the Quran, pray Witr, for Allah is One and loves that which is odd-numbered.” (Classed as sahih by al-Albani in Sahih Abi Dawud)
Witr prayer while traveling
Hence, we should continue to offer Witr prayer regularly, whether travelling or not , as the Prophet (peace and blessings of Allah be upon him) used to do. Al-Bukhari (1000) and Muslim (700) narrated that Ibn ‘Umar (may Allah be pleased with him) said: The Prophet (peace and blessings of Allah be upon him) was on a journey, atop his mount, whichever direction it was facing, gesturing the motions of the night prayer , except the obligatory prayer, and he prayed Witr atop his mount.”
Ruling on neglecting witr prayer
Ibn Qudamah (may Allah have mercy on him) said:
“Witr is not obligatory. This is the view of Malik and al-Shafi'i. Abu Hanifah said: it is obligatory. Then he said: Ahmad said: Whoever omits to pray Witr deliberately is a bad man, whose testimony should not be accepted. He wanted to emphasize that it is confirmed because of the ahadith which say that it is enjoined and encouraged.” (Al-Mughni, 1/827)
The scholars of the Standing Committee were asked: Is Witr prayer obligatory, and will the one who prays it on some days and not on others be punished for that?
“Witr prayer is Sunnah muakkadah (a confirmed Sunnah) which the believer should adhere to. Whoever prays it on some days and not on others will not be blamed for that, but he should be advised to pray Witr regularly.
It is prescribed to pray two rak’ahs during the day instead if a person misses it , because the Prophet (peace and blessings of Allah be upon him) used to do that, as it was narrated that ‘Aishah (may Allah be pleased with her) said: If sleep or sickness kept him from praying at night, the Prophet (peace and blessings of Allah be upon him) would pray twelve rak'ahs during the day. (Narrated by Muslim in his Sahih)
The Prophet (peace and blessings of Allah be upon him) usually prayed eleven rak’ahs at night, saying the salam after each two rak'ahs then praying one rak'ah on its own. But if sleep or sickness kept him from doing that, he would pray twelve rak’ahs during the day, as ‘Aishah (may Allah be pleased with her) stated.
Based on this, if a person usually prays five rak’ahs at night but he sleeps or misses them for any other reason, it is prescribed for him to pray six rak’ahs during the day, saying salam after each two rak’ahs. If his habit is to pray three rak’ahs, then he should pray four rak'ahs with two salams, and if his habit is to pray seven rak’ahs, he should pray eight with the salam after each two rak’ahs.” (Fatawa al-Lajnah al-Daimah, 7/172)
And Allah knows best.