Pb0.97La0.02(Zr1 − x−ySnxTiy)O3 (PLZST, x = 0.37, 0.25 and 0.05; corresponding y = 0.08, 0.05 and 0.03) anti-ferroelectric (AFE) thick films with different phase structure were prepared by a sol–gel method. It is found that the PLZST thick films possess coexistence of the negative and positive electrocaloric effect (ECE). The negative ECE is caused by the transition from AFE to ferroelectric phase (FE) and enhanced as the AFE–FE switching field increases. The PLZST thick films for x = 0.37, 0.25 and 0.05 have the maximum negative temperature change ΔT of − 1.0, − 2.0 and − 4.1 °C near room temperature, respectively. Moreover, the maximum positive temperature change ΔT is 1.0, 5.4 and 6.1 °C near the Curie temperature in PLZST thick films (x = 0.37, 0.25 and 0.05), respectively, which is associated with the transition from induced FE to paraelectric state. The results indicate that the coexisting negative and positive ECE could be optimized by properly controlling the phase switching properties of AFEs.