My voltswagon jetta 2000 4cyl

my engine has a loud tapping-chattering sound which only happens when the car is in gear and I hit the accelerator. it stops when I take my foot off the gas and the car runs smooth with no noise when the car is in neutral and I give it gas?

Use a higher octane gasoline.

Voltswagon Sounds Like An Electric Car!

I believe your car is possibly a Volkswagen, which means The People’s Car and was the “dream come true” of Adolf Hitler. Prior to WWII Germany was way behind the U.S.A. when it came to “A chicken in every pot and a car in every garage,” which was touted by Herbert Hoover.

How many miles on it? How long as it been doing it? How long have you had the car? Anything new on the car? Is all standard maintenance up to date?

I don't recall, but does that model call for high octane fuel?  What fuel are you using?  Does engine temperature make a difference?

I agree that it sounds like your Volkswagen’s engine is pinging. This can be due to using a lower octane fuel than is required, and if that is the case, you are literally causing expensive damage to the engine.

On the other hand, if you are using the correct octane gas for that car, then you have to explore other avenues. When was the last time that the spark plugs were replaced? Another possibility is an EGR valve that is stuck, and is in need of either cleaning or replacement.

Its really hard to tell you anything with that type of sound. While possible the engine is pinging I think it may be your exhaust system vibrating more likely. However that is another stab. If your engine is in decent running order the 2.0L or even 1.8T(recommends/requires premium) will NOT ping.

It sounds easy to isolate though by a qualified mechanic.