A study of magnetohydrodynamic squeezing flow of nanofluid between two parallel plates embedded in a porous medium is presented in this work. The ordinary differential equation which is transformed from the developed governing partial differential equations is solved using differential transformation method. The accuracy of the results of the approximate analytical method are established as they agree very well with the results numerical method using fourth-fifth order Runge-Kutta-Fehlberg method. Using the developed analytical solutions, the parametric studies reveal that when the velocity of the flow increases during the squeezing process, the Hartmann and squeezing numbers decrease while during the separation process, the velocity of the fluid increases with increase in Hartmann and squeezing numbers. Also, the velocity of the nanofluids further decreases as the Hartmann number increases when the plates move apart. However, it is revealed that increase in nanotube concentration leads to an increase in the velocity of the flow during the squeezing flow. The present study will be useful in various industrial, biological and engineering applications.