B-doping walnut shell char was prepared by the premodified doping method. The effects of B-doping amount, doping temperature, and coupling activation agent (activator amount, activation temperature) on the physicochemical structure and CO2 adsorption performance of walnut shell biochar were investigated using BET, SEM, Raman, XRD, FT-IR, and XPS characterization techniques. The results indicated that B-doping walnut shell char exhibited a high specific surface area, and the pore structure was dominated by micropores. As the amount of B-doping increased, the CO2 adsorption capacity of walnut shell char initially rose and then declined. The optimal doping mass ratio was 2:1, and the best pyrolysis temperature was 800 °C. The biochar pores became more abundant and disorderly after KOH activation. Excessive amounts of activators could damage the pore structure of activated char, thereby reducing the adsorption performance. The optimal mass ratio of the activator to walnut shell char was 1:1. As the activation temperature increased, the adsorption capacity of activated char for CO2 initially improved and subsequently declined. The optimal activation temperature of walnut shell char was 700 °C. The optimal CO2 adsorption performance was achieved by the CK1–1–700, which was 76.70 % higher compared to W800 without B-doping. Additionally, CK1–1–700 exhibited good cyclic performance. B-doping and activation treatment significantly enhanced the CO2 adsorption capacity of walnut shell char. These research findings could serve as a reference for the high-value utilization of biomass.