**Short Answer**

Shaking hands is allowed or even preferable as long as the one doing it doesn't believe that *shaking hands after prayer* is part of the prayer.

**Long Answer**

> أما المصافحة بعد الصلوات فكرهها بعض أهل العلم منهم: الإمام عزالدين بن عبد السلام، وقال:( إنما شرعت المصافحة عند اللقاء. أما من هو جالس مع الإنسان فلا)، ولقوله هذا حظ كبير من النظر، لأن العبادة مبناها على التوقيف، وكون المصافحة بعد الصلاة دائماً يجعل بعض العوام ينظر إليها على أنها سنة فيدخل في العبادة ما ليس منها.

*My translation*

[Quoted from islamway.net][1].

Some scholars hated shaking hands after prayer such as Emam Ezz El-Deen ebn Abd-El salam. He said (Shaking hands was allowed on meeting, not with someone you are setting with). Also acts of worship are *tawqeefi* **(1)**. And if people always shake hands after prayer, that may make most of people look at it as Sunnah.


Also, you can find the same meaning [here][2] at ahlalhdeeth.com.

**(1)** *tawqeefi* means that:

> it is not permissible to worship Allah, may He be exalted, through any
> act of worship unless this act of worship is proven in the shar‘i
> texts (Qur’aan and Sunnah) to be an act of worship that was prescribed
> by Allah.

[Quoted from islamqa.info][3].

Allah knows best.

[1]: https://www.islamweb.net/ar/fatwa/8063
[2]: http://www.ahlalhdeeth.com/vb/showthread.php?t=142743
[3]: https://islamqa.info/en/147608