Voters must write in the name and register the vote by making a mark in the ballot in the appropriate space selecting the write-in option. Otherwise, the vote will likely not be counted.
A voter may write-in the name of a presidential candidate on the ballot.
(Pa. Consol. Stat. Ann.§§ 2831, 2878,2872.2,2873, 2911, 2913, 2914, 3031.12)
Voters may write in the names of candidates on the Pennsylvania general ballot.BallotPedia: Write-in candidates, Pennsylvania