Murphy was on hand to head Town in front following a corner on three minutes and Rotherham were rocked again soon after, McGoldrick conjuring up a terrific strike from 25 yards to find the corner of the net.
The Millers had their chances but Conor Sammon was a coat of paint away from adding a third for Town early in the second-half, his effort hitting the post.
Town made two changes to the side that won at Wigan on Monday, Cole Skuse forced out with injury, with Teddy Bishop dropping to the bench. Paul Anderson and Kevin Bru came into the side.
Former Blue Scott Loach lined up for the visitors, who also included ex Town loanees, Paul Green and Frazer Richardson.
Loach was soon in action, keeping out a volley from Murphy but he was beaten on three minutes, the Republic of Ireland international heading in after Luke Chambers’ header had come back to him off the Rotherham ‘keeper.
The Millers had hardly recovered from that setback when they were two down on six minutes, Luke Hyam bursting forward before setting up McGoldrick, the striker curling a left foot beauty past Loach.
McGoldrick then tested the ‘keeper again with a chip, Conor Sammon’s pass going astray as he led a counter, with the Millers rocked.
Alex Revell cracked a right footer well wide as Rotherham looked to get a foothold in the game, the striker failing to make good connection inside the box from a much better opening soon after.
McGoldrick then left three opponents in his wake as he danced around the Rotherham defence before his mazy run was ended inside the box, Dean Gerken plucking Revell’s header out of the air at the other end.
Murphy and Jonny Parr linked up well down the right, the Norway international’s cross headed clear by Green as Hyam looked to pounce.
Rotherham began to threaten though, Ryan Hall’s shot blocked by Chambers, Ben Pringle then firing wide from the edge of the box.
Pringle then turned provider for Jordan Bowery, whose header 10 yards out was parried by Gerken and hacked to safety.
Loach touched Christophe Berra’s header behind, the ‘keeper then using his feet quickly to stop Chambers’ diving header from a corner finding the net as Blues went into the break with that two goal advantage intact.
Sammon almost made it three only a minute after the restart, the Derby loanee beating Loach to Kirk Broadfoot’s headed backpass but his shot hit the post with the goal unguarded.
Green headed at Gerken from Pringle’s cross as the chances continued, Revell heading wide at the back post from Richardson’s cross.
Lee Frecklington’s volley hit Chambers and went wide after Kari Arnason’s long throw before Blues made a first change, Jay Tabb on for Anderson.
Gerken was in the right position to keep out Revell’s header, McGoldrick almost finding Tyrone Mings with a clever flick inside the Millers’ box.
Murphy’s cross was arrowed in at Sammon but Arnason cleared, Elliott Hewitt then replacing the Town frontman midway through the second-half.
Balint Bajner came on for McGoldrick for the last 15 minutes in Town’s final change, the number 10 given a standing ovation as he left the pitch.
Green’s free-kick on the edge of the box was pushed out by Gerken after taking a deflection, Richardson smashing the rebound over the bar as the Millers searched for a lifeline.
Murphy sent a curler over the bar in the closing stages but Town had done enough to earn a fourth successive win for the first time since early 2012.