But there’s no need to get rid of the carpet (or the pet!) to get rid of the odor.
The biggest challenge with pet odor is that it can be much deeper than the carpet. Pet urine can easily soak into the padding the backing of the carpet, and even into the subfloor and the baseboards.
If left untreated, bacteria will start to grow causing the odors to get worse, and can also cause color loss and permanent staining in the fiber of the carpet.