The Argentine, who also missed a penalty, scored with a brilliant curling finish from the edge of the area, while Neymar marked his return to action after suspension by netting either side of halftime.
Barca remain eight points clear of nearest challengers Atletico Madrid, who beat Deportivo La Coruna 3-0.
Celta Vigo moved up to fifth in the table with a 1-0 win at home to Real Sociedad with Iago Aspas scoring the winner in the 16th minute.
An own goal by Getafe defender Juan Rodriguez put Barca on their way to their 12th straight victory after eight minutes but then Messi missed a fourth penalty of the season, before laying on passes for Munir El Haddadi and Neymar to stretch the hosts’ lead.
The 28-year-old Messi added the fourth before the break and was soon setting up Neymar again in the second half, threading the ball into the path of the Brazilian, who scored his 25th goal of the season in all competitions.
Then Arda Turan completed the thrashing with an overhead volley to finish off the hapless visitors, who have lost eight of their last nine league games.
Luis Enrique’s side are in the midst of a record of 37 matches without defeat in all competitions and the victory over Getafe matched the 12 straight league wins they achieved in 2012-13 under coach Tito Vilanova.
“We’re a unique team, different from the rest, and the opposition can’t do anything to stop us,” Luis Enrique told a news conference.
“We’re in a great situation and feeling very confident.”
Barca went into the match without having to play in midweek for the first time in 2016, yet Luis Enrique still made five changes from the team that won 4-0 at Eibar last Sunday.
The Catalans host Arsenal on Wednesday hoping to reach the quarter-finals of the Champions League after beating the Premier League side 2-0 in the first leg.
Atletico Madrid kept up their faint hopes of catching Barcelona by recording a fourth straight league win, comfortably beating Deportivo with goals by midfielder Saul Niguez, top scorer Antoine Griezmann and Argentine forward Angel Correa.