The Supreme Court of Pennsylvania redrew this district in February 2018 after ruling the previous map unconstitutional. The fourth district was reconfigured as a Democratic-leaning area to the northwest of Philadelphia for the 2018 election and representation thereafter. Geographically, it is the successor to the 13th district, represented by Democrat Brendan Boyle. Boyle, however, opted to run in the neighbouring 2nd district, the geographic successor to the 1st district, represented by retiring incumbent Bob Brady. The bulk of Perry's representation, including York and Harrisburg, will become part of a redrawn tenth district. Gettysburg and Adams County will join a new, heavily Republican 13th District, which will be the successor to the old ninth district of retiring Congressman Bill Shuster. Areas to the south and east of York join Lancaster in a redrawn, heavily Republican eleventh district, the successor of Republican Lloyd Smucker's 16th district.
This district changed drastically when Pennsylvania's new districts went into effect on January 3, 2013. Due to slower population growth than the nation as a whole, Pennsylvania lost a seat in Congress in reapportionment following the 2010 United States Census, and this seat was effectively eliminated. Most of the 4th district was merged into a redrawn 12th district, and the previous 19th district was rebranded as the 4th. From 2003 to 2013 it included suburbs of Pittsburgh as well as Beaver County, Lawrence County, and Mercer County. The district had a slight Democratic registration edge, although it has voted for Republicans in several federal elections over the past decade, including for President George W. Bush in 2000 and 2004, as well as Lynn Swann for governor in 2006. The heart of the district was a string of mostly white and middle class suburbs. Plum and Murrysville, two large and mainly residential boroughs, are the main towns in the suburban portion of the district that lies to the east of the city. Also included were the many suburban areas that make up northern Allegheny County and southern Butler County, Pennsylvania, including the larger communities of McCandless and Franklin Park, as well as several exclusive suburbs that have long been home to Pittsburgh's old money elite, including Fox Chapel and Sewickley. The northern suburbs had a generally moderate voting populace, which trends Democratic but makes up the swing vote, especially in races for national office. Further north, the district took on a different character. The suburban areas of Beaver County are somewhat less affluent and were heavily labor Democratic. The areas of Lawrence County and Mercer County had a more rural feel, but also had a union Democrat center within the city of New Castle.