Due to low costs, pipelines are commonly used for transporting hazardous substances such as combustible liquids and gasses. Currently, chemical industrial parks and gas production stations have dense pipeline networks. In the case of a pipeline leakage and subsequent fire accident, the adjacent pipelines could be directly impinged by the flame or engulfed in hot smoke, with the potential to result in a chain of accidents and catastrophic consequences. It is thus of practical importance to develop an efficient thermal protection material for pipelines. In this study, a new type of bio-based gel material was prepared for pipeline thermal protection, using guar gum (GG) as the gelling agent, sodium tetraborate (B) as the crosslinking agent and magnesium chloride (MgCl2) as the fire retardant. Firstly, orthogonal experiments were conducted to examine the gelling time of the gel and determine the optimal formulations that meet the protection requirements. Subsequently, water retention, thermal stability and the microstructure of these formulations were analyzed. Finally, the thermal protection performance of the gel formulations was evaluated under the direct impingement of flames or high-temperature smoke. The results indicated that the best performance was achieved by the formulation with GG, B and MgCl2 mass fractions of 2.5, 0.6 and 0.5 wt%, respectively. This formulation also exhibited the best water retention capacity and thermal stability. In the pipeline thermal protection experiments, this formulation achieved effective protection times of 216 s (for a 90 mm diameter) and 312 s (for a 120 mm diameter) for the lower part of the pipeline under direct flame impingement. Under high-temperature smoke impingement, this formulation also showed excellent performance. These research and findings can provide an important foundation for the further development of thermal protection materials for pipelines under fire conditions.