John Fogerty wrote "Porterville" while serving on active duty in the Army - he was in a Reserve unit. He recalled in Bad Moon Rising: The Unofficial History of Creedence Clearwater Revival by Hank Bordowitz: "I went into the Army in early '67, and they got you marching all day out on an asphalt parade field about a mile square. And during all that marching, I would get delirious, and my mind would start playing little stories. They all seemed to be sort of swampy and Southern, in the woods and with snakes; Br'er Rabbit, Mark Twain, a great old movie with Dana Andrews and Walter Brennan called Swamp Water. So I ended up writing the song 'Porterville' while I'm stomping around in the sun."
Fogerty refers to his father in this song, but it is only semi-autobiographical, as he took some liberties. In the song, Fogerty's dad gets hauled off to jail; in real life, he left the family on his own accord when John was nine years old.
The band recorded this song while they were still using the name The Golliwogs and released it under that name in 1967 on Scorpio Records, a subsidiary of Fantasy. Later that year, Scorpio released it again when the band changed their name to Creedence Clearwater Revival, making it their first single under that moniker.
In 1968, the band was transferred to the main Fantasy Records label, which released the first Creedence Clearwater Revival album, including this song on the track list. In 1975, after the Creedence deal with Fantasy went south, the label included it on a compilation album called Pre-Creedence.
For John Fogerty, this marked a shift in his songwriting style. "Everything changed after that," he said. "I gave up trying to write sappy love songs about stuff I didn't know anything about, and I started inventing stories."
The title is never mentioned in the lyrics. It likely refers to the city of Porterville, California.