How to Clean Madhiy
Question

Is prayer valid if one did not wash Madhiy (pre-seminal fluid) from the testicles? I heard that the Shafi `is, Malikis, Hanafis and some of the Hanbalis do not think that we need to wash the testicles.
Praise be to Allah.How to clean Madhiy
Madhiy is something impure from which we must purify ourselves.
Ibn `Abd Al-Barr (may Allah have mercy on him) said:
“The regular, well-known substance of Madhiy is a matter concerning which there is consensus and no difference of opinion among the Muslims that it is obligatory to do Wudu because of it, and it is obligatory to wash it off because it is impure." (At-Tamhid (21/207)
So if Madhiy is emitted and any of it gets onto the body, it is obligatory to wash the place it got onto. If someone prays knowing that there is any Madhiy on his body and he deliberately did not wash it, then his prayer is not valid .
For the ruling on prayer offered when the body or clothes are not pure, please see the answers to questions no. 12720 and 195117 .
What to do if Madhiy gets into the testicles 
If the Madhiy gets onto the testicles, then they must be washed in order to remove this impurity, as stated above.
But if the Madhiy did not get onto them, and it did not go beyond the place where it was emitted, then in this case there is a difference of opinion among the scholars: is it sufficient to wash only the area of the penis where it was emitted, or must the entire penis, along with the testicles, be washed?
The view of Imam Ahmad (may Allah have mercy on him) is that both the penis and the testicles must be washed.
Al-Mirdawi (may Allah have mercy on him) said:
“Based on the view that it is impure, the penis and testicles must be washed if it is emitted, according to the correct view." (Al-Insaf c2/328-329)
He (may Allah have mercy on him) quoted as evidence for that the report narrated in Al-Bukhari and Muslim from `Ali (may Allah be pleased with him), according to which the Prophet (blessings and peace of Allah be upon him) enjoined washing the private part; the apparent meaning indicates that what is meant is the entire private part. In books other than Al-Bukhari and Muslim – such as Musnad Ahmad etc. – it is narrated that it is enjoined to wash the testicles.
`Ali (may Allah be pleased with him) said: I was a man who emitted a great deal of Madhiy, so I told a man to ask the Prophet (blessings and peace of Allah be upon him) about that, because of the position of his daughter. He said: “Do Wudu and wash your private part.” (Al-Bukhari, 269 and Muslim, 303)
The apparent meaning of the word is that the entire private part is to be washed; however, the majority of scholars said that what is meant by “private part” here is the place where the Madhiy is emitted, and not the entire private part. They supported that by comparing it to all other types of impurities; in all other cases it is only required to wash the place where the impurity is.
Ibn Daqiq Al-`Id (may Allah have mercy on him) said:
“The scholars differed as to whether he should wash the entire private part, or only the place where the impurity is. The majority are of the view that washing may be limited to the place where the impurity is…" (Ihkam Al-Ahkam  1/74)
An-Nawawi (may Allah have mercy on him) said:
“What is required is to wash only the place where the impurity is. This is our view and the view of the majority." (Al-Majmu` 2/144)
Ibn Rajab (may Allah have mercy on him) said:
“The scholars differed concerning what is meant by the command to wash the private part in the case of Madhiy. Does it mean to wash only the area of the private part where the Madhiy got onto it – as is the case with urine – or to wash the entire private part?
There are two views concerning that, both of which were narrated from Malik and Imam Ahmad." (Fath Al-Bari  1/304)
Ibn Daqiq Al-`Id (may Allah have mercy on him) said:
“The majority of scholars chose not to interpret the word “private part” as referring to the entire area; rather they focused on the context, as what makes washing obligatory is the emission of the substance, which dictates that one may limit washing to the place from which it was emitted and the place it got to [on the body or clothes]." (Ihkam Al-Ahkam 1/74)
Abu Ja`far At-Tahhawi (may Allah have mercy on him) said:
“In support of the view that only the place of emission and the place it got to [on the body or clothes] is to be washed, we may say by analogy that the emission of Madhiy is an emission of something that invalidates Wudu; as in the case of urination and defecation, all that is required is to wash the place from which it was emitted and the place it got to [on the body or clothes], and there is no need to wash any more than that, unless one wants to do Wudu and pray. The same applies with regard to bleeding from any part of the body, according to the view of those scholars who regard bleeding as invalidating Wudu.
This is the way in which the emission of Madhiy should be dealt with, since it is something that invalidates Wudu; it does not require any washing apart from washing it from wherever it got on the body, apart from washing in order to purify oneself for prayer (Wudu). Thus this argument is further supported by reasoning.
This is the view of Abu Hanifah, Abu Yusuf, and Muhammad ibn Al-Hasan (may Allah have mercy on them)." (Sharh Ma`ani Al-Athar  1/48)
Those who say that it is impure responded to that by noting that there is nothing to prevent suggesting that washing more than the place where it is emitted is required. There is a similar case to that in Islamic teaching, which is that it is obligatory to wash the entire body when Maniy is emitted . They also mentioned a benefit of that, which is that washing the penis and testicles stops the emission of Madhiy.
Shaykh Al-Islam Ibn Taymiyyah (may Allah have mercy on him) said:
“And because it is emitted as a result of desire, therefore it is reasonable to suggest that it is obligatory to wash more than the place where it is emitted, as in the case of Maniy . That is because the testicles are its vessel, so washing them will put a stop to it." (Sharh Al-`Umdah 1/103)
It was narrated by Imam Ahmad in Al-Musnad (2/293), and by Abu Dawud (208), from Hisham ibn `Urwah, from `Urwah, that `Ali ibn Abu Talib said to Al-Miqdad (may Allah be pleased with them) … and he mentioned a similar report and said: So Al-Miqdad asked the Messenger of Allah (blessings and peace of Allah be upon him), and he said: “Let him wash his penis and testicles.”
Ibn Hajar said in At-Talkhis Al-Tahbir (1/117):
“It was narrated by Abu Dawud via `Urwah from `Ali, and in it it says: “Let him wash his testicles and his penis.” `Urwah did not hear [directly] from `Ali, but Abu `Awanah narrated in his Sahih from `Ubaydah from `Ali with this additional text, and there is nothing wrong with its Isnad [chain of narration].”
As-San`ani said in Subul As-Salam (1/199):
“As it is authentic, there is no reason not to accept the ruling based on it.”
Abu Dawud (211) narrated from Al-`Ala ibn Al-Harith, from Haram ibn Hakim, from his paternal uncle `Abdullah ibn Sa`d Al-Ansari (may Allah be pleased with him), who said: I asked the Messenger of Allah (blessings and peace of Allah be upon him) about what necessitates Ghusl and about water [i.e., fluid] that is emitted [successively] after water. He (blessings and peace of Allah be upon him) said: “That [fluid] is Madhiy, and every male emits Madhiy. So wash it from your private part and your testicles, then do Wudu as for prayer.” (1/207). (Classed as authentic by Shaykh Al-Albani (may Allah have mercy on him) in Sahih Sunan Abu Dawud, 1/381)
Shaykh Ibn Baz (may Allah have mercy on him) said:
“What is required in the case of Madhiy is to wash the penis and testicles." (Fatawa Ash-Shaykh Ibn Baz, 17/58)
The scholars of the Permanent Committee for Ifta said:
“… With regard to Madhiy, it is impure. If you emit Madhiy, you must wash the penis from its base, and the testicles, and sprinkle water over whatever parts of the clothes and body the Madhiy got onto, because the Prophet (blessings and peace of Allah be upon him) instructed `Ali to wash his penis and testicles and do Wudu in the case of Madhiy, and he instructed him to sprinkle water over whatever of it got onto his clothes.
And Allah is the source of strength. May Allah send blessings and peace upon our Prophet Muhammad and his family and Companions.” (Permanent Committee for Academic Research and Ifta- `Abdullah ibn Qa`ud, `Abdullah ibn Ghadyyan, `Abd Ar-Razzaq `Afifi, `Abd Al-`Aziz ibn `Abdullah ibn Baz."(Fatawa Al-Lajnah Ad-Daimah 5/382)
Shaykh Ibn `Uthaymin (may Allah have mercy on him) was asked:
What is the correct view with regard to washing the penis and testicles when Madhiy is emitted?
He replied:
“The correct view is that it is obligatory, and there is a medical benefit in doing that, which is that washing the penis and testicles stops the emission of Madhiy ." (Ta`liqat Ash-Shaykh Ibn `Uthaymin `Ala Al-Kafi)
So the correct view is that it is obligatory to wash the penis and testicles when Madhiy is emitted, because of the soundness of the Hadith which enjoins that.
With regard to the validity of prayer , with regard to such matters which are subject to Ijtihad, there is no blame on the one who follows one of the two scholarly views, so long as he believes that it is the correct view, or he is following a scholar whose view it is.
And Allah knows best.