Carefully check the 10 steps for preventing litterbox problems mentioned previously. Perhaps the solution is as easy as adding more litterboxes, cleaning more frequently, or changing the brand of litter. Special consideration should be given to declawed cats as paw sensitivity may be the cause for litterbox avoidance and kitty may require a box or tray without litter. Never punish the cat for eliminating outside of its litterbox. Housesoiling occurs when the litterbox, its contents, or its location is offensive to the cat or when the cat is stressed by the environment.
Punishment only increases the cat's stress.
If a health issue or aversion to the litterbox can be ruled out, consider that the problem could be anxiety-related. Any intrusion on the cat's territory, whether human, animal, or even a new piece of furniture, can cause a cat to feel threatened, insecure, and stressed. This may result in his need to mark his territory. This is usually accomplished by spraying urine on vertical surfaces, or less frequently, by squatting and urinating or defecating on horizontal surfaces. The more cats in the household, the more likely that one or more of them will spray.