Based on the advantages of the chaos particle swarm optimization algorithm and the generalized inversion technology, this article estimates the source parameters and site effects of the Wenchuan earthquake. We used 440 sets of strong‐motion records obtained from 43 aftershocks, and the area covered by the records was divided into subregions A and B. Initial separation of source, path, and site from the seismic spectra of subregions A and B using generalized inversion technique and then the source‐site optimization model is established using chaotic particle swarm technology. From path‐corrected records, we obtained absolute site effects for 33 stations and equivalent source parameters for 43 earthquakes. We made the following conclusions: (1) The moment magnitude was lower than the local magnitude determined by China Earthquake Network Center. The self‐similarity of the Wenchuan earthquake was confirmed. The stress drop averaged 2.31 MPa, and it was independent of the magnitude size and focal depth. (2) In the frequency 1–10 Hz, the quality factor values in subregions A and B are and . The decay rate of the crustal medium in the western region of the west Sichuan plateau is significant compared to the eastern part. (3) Bedrock stations 51MXT and L2007 have site effects within a certain frequency. The effect of slope topography on site predominant frequency is not apparent, and the site effects increase with the increase in elevation. The shape of the site amplification curve is more similar in the middle‐ and low‐frequency bands, and different attenuation phenomena will appear in the high‐frequency band.