Terrestrial heat flow plays an important role in the study of plate tectonics, geothermal resource exploration and earthquake genesis. The measurement of terrestrial heat flow usually utilizes deep boreholes, which is expensive and inconvenient for high altitudes or mountainous terrain. In hydrothermally active areas, the temperature distribution is disturbed by heat convection, resulting in difficulty in obtaining conductive heat flow. In fact, heat can be used as a tracer to quantify groundwater flow. This article presents a method for calculating terrestrial heat flow suitable for hydrothermally active areas, which can correct the influence of groundwater flow to obtain the conductive heat flow reflecting the deep thermal background. The method uses temperature-time series at multiple depths of the shallow crust to calculate the groundwater flow rate. The convective heat flux component is then removed based on information on groundwater movement, and the conductive heat flow can be acquired. The feasibility of the method is verified by a theoretical model. This method has been applied to estimate terrestrial heat flows in northwestern Yunnan, China, which is a hydrothermally active area. The heat flow obtained through our method range from 54.5 to 130.3 mW/m2, with an average of 94.5 mW/m2, consistent with the high-quality measured heat flow values in the boreholes. This study provides new perspectives for acquiring terrestrial heat flow in areas that are affected by fluid activities.