China’s extensive development model of pig industry gives rise to serious resource and environment bottleneck restriction,it is urgent to transform the existing development model into ecological farming model. In this process,farmers’ behavior will play a key role. On the basis of summarizing development connotation and characteristics of ecological agriculture,using survey data of 323 pig farmers in 6 provinces,based on the Theory of Planned Behavior( TPB) it introduced individual characteristics and external environment constraint variables,and made an empirical analysis on factors influencing intention and behavior of pig farmers’ ecological farming using the Structural Equation Model( SEM). Results indicate:( i) ecological farming intention of pig farmers has the largest direct effect on their ecological farming behavior;( ii)ecological farming cognition of pig farmers has significant positive effect on their ecological farming behavior;( iii) external environment has the largest indirect effect on their ecological farming behavior,followed by the overall effect,and external environment has significant positive effect on ecological farming attitude and cognition of pig farmers;( iv) individual characteristics( educational level and income level) of pig farmers influence ecological farming behavior of pig farmers through their ecological farming attitude and intention,but the degree of influence is limited.