I had an annoying problem for about the a year. Its a 1998 Jeep Wrangler and it would start fine then after 5 mins it would idle poorly. If I ran it down the road it would spit and sputter. Then, shut it off, turn it back on and it would run fine all day long until the engine got cold again. I did a lot of research on this forum so I thought I would give back by posting what I found. Maybe it will help someone in the future.
In my case, it was the upstream O2 sensor which is right off of the bottom of the exhaust manifold. I replaced it and it runs great now but what I found is that are about 6 or 7 different parts that could cause the problem. Each part is about 60 bucks. I did not get any testing codes so I just started swapping parts. I went through 3 parts before I hit the right one. Here is the list of the problematic parts. I abbreviated them but you can look them up anywhere in this forum. The parts are TPS, CPS, MAP, IAC, Coolant Sensor, Upstream O2 and Downstream O2.
First start by spraying out the throttle body with TB Cleaner. Next, do a tune-up (rotor, cap, plugs, etc). If none of that works then start swapping parts. On my Jeep, I did Downstream O2 then TPS then Upstream O2. The TPS helped a lot but the problem did not go completely away. In hindsight, I see a lot of O2 sensors getting replaced on these forums so I would start there. Also, that's what the dealership told me too. But, if you want to keep from paying $70/hr in labor then just start swapping parts. Most of them are easy to get to and unplug and swap with a couple of screws. I hope this helps someone! --- Mark
PS. I posted this as a reply to another thread but I thought I would put it here so maybe it will help more people. It seems to be a common problem with TJs