The coseismic frictional temperature is increasingly recognised as an important factor for the transformation mechanism in shallow crustal faulting. We report changes in the mineralogical and geochemical compositions across the fault zone in the Shaba (SB) exposure of the 2008 Wenchuan earthquake (Mw 7.9), which contained the maximum value of vertical displacement and cut through shale-rich strata by the principal slip surface. Assuming Yb to be an immobile trace element, with respect to those in the adjacent damaged zone and wall rocks, Li, Rb, Cs and most light rare earth elements (LREE) exhibited marked enrichments of 143%, 247%, 475% and >60%, respectively; and a 40% depletion of Sr and <5% depletion of most heavy rare earth elements (HREE) was found, responding to mineralogical transformation such as alteration and dissolution of feldspar and formation of abundant clay minerals. In addition, heterogeneous adsorption of clay minerals could result in fractionation between and within LREE and HREE as well as negative Eu anomalies and positive Ce anomalies. The element enrichment/depletion model of the northern segment of the Yingxiu–Beichuan (YX–BC) fault zone was quite different from the middle/southern segments characterising faults in carbonate and granitic rocks. Through model calculation, the calculated trace element compositions (Li, Rb, Sr, Cs, Ba, La, Sm and Pb) of the fault gouge were obtained at 250 °C, 300 °C and 350 °C, and were produced by frictional heating. By comparing with the observed values, we suggest that high temperatures derived from frictional heating or due to buffering of the slip zone temperature by evaporation of pore water during the earthquake within the principal slip surface in the northern segment of the YX–BC fault zone may not have existed. Mechanical crushing and chemical alteration (not under high-temperature conditions) within the fault zone during the coseismic stage may result in mass removal and element enrichment/depletion. KEY POINTS Mineralogical and geochemical compositions were reported in the Shaba exposure of the 2008 Wenchuan earthquake. Li, Rb, Cs and most LREE exhibited marked enrichments in the fault gouge. Fractionation between and within LREE and HREE, negative Eu anomalies and positive Ce anomalies occur in the fault gouge. High temperatures may not have existed within the principal slip surface of the northern segment of the YX–BC fault zone.