The invention discloses a temporary plugging agent for drilling fluid, and belongs to the technical field of petroleum drilling. The temporary plugging agent is prepared from the following raw materials in percentage by weight: 60 to 70 percent of hexadecane, 0.5 to 1 percent of catalyst persulfate, 10 to 20 percent of phenol, 10 to 20 percent of formaldehyde, and 1 to 2 percent of cationic surface active agent. The preparation method comprises the following steps of: 1, adding the hexadecane liquid into a reaction kettle, heating the reaction kettle to 50+/-5 DEG C, adding the phenol, stirring the mixture, controlling the temperature to be 80+/-5 DEG C and the pressure to 2+/-0.5MPa, slowly adding the catalyst, adding the formaldehyde solution after 2 hours, stirring the mixed solution for 2 hours while continuously controlling the temperature to 40+/-5 DEG C, adding the surface active agent, and stirring the mixed solution for 2 hours; and 2, relieving the pressure in the reaction kettle to normal pressure, extracting the mixture, drying the mixture at the temperature of 100+/-5 DEG C, and then grinding the dried mixture to obtain the temporary plugging agent. The softening point temperature of the temporary plugging agent is within a wide range from 70 to 140 DEG C, so that the temporary plugging agent can almost meet the needs of all layers of earth.