Remove plants from the door to take away any need for the bird to go near it. Move any bird feeders further from the door to keep birds away from the entrance, which reduces the chances of it pecking at the door.
Place a silhouette cutout of a predatory bird, such as a hawk or a falcon, on the door or entryway to the home.
Add a set of blinds to the front door window to make it more difficult for the cardinal to see its reflection in the glass. Nonreflective papers like construction paper and paper bags can also be used instead of blinds.
Cover reflective surfaces of the door with strips of masking tape. This breaks up the reflection the bird sees.
Rub a bar of soap over the glass of the window or shiny surface of the door to reduce how much it reflects. The soap can be removed once the cardinal has stopped pecking at the door, or after nesting season is over when the bird may not be as territorial.