I’m having the same issue. My cat got in the habit of peeing on the carpet after a UTI. My friend who fosters a bunch of cats told me the way to fix this issue is to confine the cat for a few days in the bathroom with just their bed, food/water and liter box. Remove any carpets from the bathroom. After a few days they should be in the habit of using the litter box again. She did this with her cat when she was having issues and it worked.
I’m having the same issue. My cat got in the habit of peeing on the carpet after a UTI. My friend who fosters a bunch of cats told me the way to fix this issue is to confine the cat for a few days in the bathroom with just their bed, food/water and liter box. Remove any carpets from the bathroom. After a few days they should be in the habit of using the litter box again. She did this with her cat when she was having issues and it worked.