Porter was elected as a Republican to the Sixty-second and to the nine succeeding Congresses and served until his death. He was the Chairman of the United States House Committee on Foreign Affairs during the Sixty-sixth through Seventy-first Congresses. He was an unsuccessful candidate for Mayor of Pittsburgh in 1913. He was appointed in 1921 to represent the United States House of Representatives on the advisory committee to the Washington conference on armament limitations, and he represented the United States at the centennial of Brazil’s independence, in 1922. He was a member and chairman of the American delegation to the Second International Conference on Opium, at Geneva in 1924 and 1925, although he unexpectedly withdrew the American delegation prior to the Conference's conclusion. The American delegation's proposals for more stringent drug control were rejected.