the present invention provides for plugging a porous formation to prevent undesirable fluid flow in well drilling by injecting through the borehole and into the porous formation a water solution of methylcellulose. The water solution is forced into the formation and held there under pressure until the solution gels. It is a particular property of water solutions of methylcellulose to gel as the temperature increases. A low concentration water solution of a water-soluble methylcelluose forms a stiff gel when the solution is heated to above a determinable temperature. Since underground formations are generally at an increased temperature, the method of this invention includes injecting a water solution of methylcellulose into a porous formation and holding pressure on the solution until the heat of the formation It has been discovered that particular types of methylcellulose are effective in plugging a porous formation. The effective use of the solution for plugging a formation depends on the concentration of the methylcellulose in the solution.