Regarding whole cottonseed (WCS), cottonseed meal (CSM), and cottonseed hull (CSH), in situ rumen incubation was applied to determine their nutrient and gossypol degradation characteristics and bacterial colonization profile in lactating Holstein cows. Nylon bags containing the cotton by-products were incubated for 0, 6, 12, 24, 36, 48 and 72 h in the rumen, respectively. The relationship between nutrient degradability and free gossypol (FG) content were examined, and the differences in the composition and inferred gene function of the colonized microbiota were studied. As a result, CSM presented highest effective degradability of dry matter, neutral detergent fibre and acid detergent fibre, but the highest effective degradability of crude protein was found in WCS. Free gossypol disappearance rate increased significantly in the first 6 h, and it reached approximately 94% at 72 h of incubation among all samples. The level of FG did not affect nutrient degradability of cotton by-products. Significant differences were noted in attached bacterial community structure among cotton by-products after 24 h rumen incubation. Among the most abundant taxa at genus level, a greater abundance of Cercis gigantea and Succiniclasticum was observed in WCS samples, whereas the CSH and CSM samples contained a greater proportion of Prevotella 1 and Rikenellaceae RC9 gut group. The redundancy analysis revealed that the level of neutral detergent fibre, ether extract, and FG in cotton by-products were significantly positive related with the composition of the attached bacteria. Collectively, our results revealed the dynamics of degradation characteristics, and the difference in the composition of bacterial colonization. These findings are of importance for the targeted improvement of cotton by-products nutrient use efficiency in ruminants and further understanding of the gossypol degradation mechanism in the rumen.