Cattle farm wastewater, as a significant reservoir for antibiotic resistance genes (ARGs), has received wide attention. Intracellular and extracellular ARGs (iARGs and eARGs) were detected during wastewater treatment, including solid–liquid separation, anaerobic regulation, upflow anaerobic sludge blanket (UASB) digestion, an anoxic–oxic-anoxic–oxic (A2O2) process, a membrane bioreactor (MBR), and ozone disinfection. Ten abundant ARGs were chosen as the target ARGs according to metagenomic sequencing. The concentrations of the total target iARGs and eARGs were 6.12 × 107 and 3.24 × 106 copy numbers/mL in raw wastewater, and then 3.79 × 103 and 3.95 × 105 copy numbers/mL in final effluent, because UASB, A2O2, MBR and ozone disinfection can gradually reduce the concentrations of most ARGs. The concentrations of ARGs were positively correlated with almost all wastewater quality indicators. Positive correlation was also observed between iARGs and Bacteroidetes, Firmicutes and Spirochaetes, indicating that the bacteria in these three phyla might be the main hosts of ARGs. Wastewater quality indicators and bacterial community composition affected the distribution and removal of ARGs during cattle wastewater treatment.