Rip up the carpet. You may have to cover your floor in kitty litter...
I would think your best option is to try and keep your cat in a small space with the cat tray.....crate training as it is called the cat will cop on that if you use the tray its better than pooping all over the area they are in. Its the only way i think you will suceed.........a little bit rough i know but i should be only a day or so and then increase its area daily after that and see what happens.....good luck but remember your cat is not a kitten and its a big change for them.......be a little patient i will happen for you.........
My first thought would be a visit to the Vet to make sure there isn't a physical problem.
Has anything changed in your home? More stress, a new baby, anything?
And, if none of this works, I would contact an Animal Behaviorist to get some tips on what else you can do.
Above all, don't reprimand it. Animals are not children, they don't understand. Be patient.
I hope this has helped a little, and good luck my friend!
Keep the cat in the bathroom with food, water and a litter box few a few days. If it poops on floor put the poop in the litter box.
I had this same problem with my elderly cat, to the point where I just didn't know what I was going to do! I searched online and saw that a lot of people had had good luck with a kitty litter called Cat Attract. (You don't way where you are, but this is available in the US.) It has herbal compounds in it that make the cat want to use it. I bought it and it worked! It is on the expensive side, but it is definitely cheaper than replacing your carpets. (I also found a great product for getting cat pee out of carpets so they won't use them again is Nature's Miracle.)
However, as others have pointed out, I would suggest giving Cat Attract a try only after you've had your kitty examined by your vet to make sure his problem isn't physical in some way.