Following retirement between 1855 and 1859, he was returned to active duty and took command of St. Mary's In that sloop-of-war, he patrolled the Pacific coasts of Mexico and Central America for two years protecting American interests in that area.
Between January and August 1862, Porter served gallantly up and down the Mississippi River. On 10 January, Essex and St. Louis engaged three Confederate gunboats and forced them to retreat to the protection of Southern shore batteries. The two Union gunboats repeated the feat three days later and succeeded in damaging their opponents. Only Confederate shore batteries prevented the capture of the three steamers.
On 6 February, Essex joined the rest of Foote's gunboat squadron in the attack on Fort Henry. Porter's ship, second in line, sustained heavy fire from shore batteries and received at least 15 direct hits. About half an hour into the fray, Essex took a 32-pound shot through her bow shield. It pierced her boilers, releasing steam which severely scalded 28 men. Commander Porter—himself blinded and scalded—continued to conn his ship until she was clear of the action.
Though still severely hampered by his injuries, Porter directed the extensive repair and renovation of Essex from his sick bed. At the same time, he also superintended the construction of two other warships, the ironclads Lafayette and Choctaw.
Porter completed the renovation of Essex at St. Louis in July and rejoined the Western Flotilla at Vicksburg, Miss. later that month. At dawn on the 22d, Porter took Essex out to confront the Confederate ironclad ram CSS Arkansas which had recently left her refuge in the Yazoo River to seek greater safety under the cover of Vicksburg's shore batteries. In company with the smaller converted riverboat Queen of the West, Essex moved in toward the Southern warship. During the approach of the two Union ships, Confederate shore batteries subjected them to a withering fire. Finally, Essex struck Arkansas a jarring blow but at an oblique angle. As a result, she glanced off the Southern ram and ran aground parallel to her adversary. Porter worked furiously to free his ship and, after much difficulty, managed to retire, with Queen of the West close behind.
Thereafter, since Essex had sustained only minor damage, Porter kept her on station patrolling the lower Mississippi River between Vicksburg and Baton Rouge. On 5 August, his ship and Sumter assisted Union Army troops in repelling a Confederate land attack on Baton Rouge. The following morning, he headed north to Vicksburg to confront Arkansas once more. He found his quarry on a bend in the river, close to the shore. In the ensuing bombardment, Porter used an incendiary shell which he himself had invented. After about 20 minutes of shelling, Arkansas erupted into flames and soon blew up. Evidence suggests that the Confederate crew had set their own ship afire to prevent her capture. Be that as it may, Porter's bold action played no small part in the ram's destruction. Moreover, Congress recognized the role played by Porter and his ship in June 1864 when they belatedly awarded the Essex crew $25,000 in prize money.
Porter's last real action in the war occurred in September 1862 when Essex conducted a bombardment of Natchez, Miss., and duelled the shore batteries at Port Hudson, La. Later that month, he returned to New Orleans where new orders awaited him. Promoted to the rank of commodore, Porter was assigned to duty at New York. There, he served in various capacities until hospitalized in April 1864. On 1 May 1864, Commodore Porter died of heart disease at St. Luke's Hospital in New York City. Although he was buried initially at Greenwood Cemetery in New York, he was moved to Philadelphia, Pa. in June and laid to rest beside his famous father, Commodore David Porter.
In 1942, the destroyer USS William D. Porter (DD-579)