Answered by: Maulana Maruf Ahmed
I’m a Muslimah and I follow the Hanafi school of thought. What is the ruling on a secret nikkah for the purposes of avoiding haram outside of marriage?
بسم الله الرحمن الرحي
There are two issues that need to be addressed. The first of them is the ruling of relationships between opposite genders outside of marriage. The second is the ruling of conducting a nikah in secret.
As for the first issue, there are many ahadith which warn against unnecessary intermingling and interaction between opposite genders. Among them is the following hadith;
The Prophet (sallallahu alaihi wasallam) said: “The adultery of the eyes is the sight (to gaze at a forbidden thing), the adultery of the tongue is the talk, and the inner self wishes and desires and the private parts testify all this or deny it.” 
As for holding a nikah in secret, although valid in the Hanafi madh’hab if held in the presence of two adult male Muslim witnesses, it is discouraged as the Sunnah is to openly declare the marriage. Furthermore, it may incur the displeasure of the parents and result in problems later on.
Therefore, the ideal thing to do is for both parties to consult their understanding elders and seek to have nikah in the correct manner.
Only Allah knows best.
Written by Maulana Maruf Ahmed
Checked and approved by Mufti Mohammed Tosir Miah
Darul Ifta Birmingham
 Sahil al-Bukhari, Hadith 6243
This answer was collected from DarulIftaBirmingham.co.uk, which is run under the supervision of Mufti Mohammed Tosir Miah from the United Kingdom.