ABSTRACT Alternanthera philoxeroides (AP) is a typical invasive plant. The quick spread of AP biomass may cause serious threat to ecological balance and biodiversity of the local area. However, AP has a high content of potassium, making it possible for preparing biochar through a self-activation process. In this study, AP biomass was employed to prepare porous carbon through a simple one-step pyrolysis. The effect of pyrolysis temperature (T) and carrier gas flow rate (v) onto the target carbon was intensively discussed. The obtained carbon were employed as adsorbents for methylene blue (MB) adsorption. Results showed that both of the T and v played great influence on the porous structure of the obtained biochar. Higher pyrolysis temperature and lower carrier gas flow rate were in favor of the formation of micropore and mesopore. The biochar obtained from 900°C pyrolysis temperature and 20 cm3 min−1 carrier gas flow rate (BC/900–20) possessed a satisfying specific surface area (825.6 m2 g−1) through the direct one-step pyrolysis, verifying the existence of pyrolysis gas self-activation and inorganic salt template self-activation effect. The maximum adsorption capacities calculated from Langmuir model were 424.9 mg g−1 for BC/900–20, which was comparable to that of the adsorbents reported recently.