Car won't idle after engine swap

1995 Mazda Protoge
1.5 Ltr 4 Cyl
162K Miles

I just swapped engines in this car as the first engine threw a rod. Put everything back together and the car will start but not idle and will immediately shut down if I don’t keep throttle pressed.

Not sure were to begin with troubleshooting, any help appreciated.

I’m thinking maybe an air leak, like in the intake manifold gasket. Try having someone else start the car while you shoot some carb cleaner around the gasket. If that helps it idle, it’s sucking air through the gasket.

If the engine you installed was complete, the replacement engine may have a defective Idle Air Control valve.

Tester

Is the “new” engine from the exact same model and model year as the old one?
If not, this could possibly be a case of an ECM that is not compatible with the “new” engine.

It was in fact the air intake, not related to the fuel as was my first thought. On the airbox there was an electrical plug that connected to the inside of the box with a rubber gromit, the plug was pointy at the end going in. Not sure what this is called (it is next to the connector for the mass airflow sensor) but I foolishly had not plugged that back in. Also, there is a rubber T-hose coming out of the air filter hose and one end was open, I plugged it up. One or both of those things were the problem because now the car fires up and idles fine.
Thanks very much.

The probe-like thing that goes into the air box is probably the sensor which measures the intake air temp. The t-hose off the air intake box probably supplies air to a device which bypasses the throttle valve during idle, allowing enough air into the intake manifold to obtain the proper idle rpm. I expect that is what the problem was. Glad you got it running.