Several mesoporous alkylated poly(ionic liquid)s (PILs) were synthesized precisely with divinylbenzene (DVB) and alkyl-functionalized ionic liquids (IL) through free radical copolymerization. After served as support for Candida antarctica lipase B (CalB) with a immobilized efficiency of 99%, this biocatalyst was further demonstrated highly advantageous for biodiesel production under mild conditions. Typical catalyst CalB0.2@PIL-C8 was capable of effectively converting soybean oil into biodiesel with a yield of 68.2%, which is higher than Novozym 435. And the biodiesel yield was almost 1.5 folds compared to that of free CalB under the same conditions. The recovery test and leaching test further confirmed its stability. The hydrophobic PILs not only provide suitable reaction micro-environment but also utilize the flexible hydrophobic alkyl chains to keep a conformation with more open active sites of lipase. This work discloses a promising strategy towards activating and stabilizing lipase dominated by hydrophobicity and surface potential regulation of support in heterogeneous enzymatic catalysis.