It's generally not necessary to unplug the battery when changing the spark plugs, but it's a good idea. Many car manufacturers recommend disconnecting the battery because there is a risk of electrical shorting when working near the spark plugs. Spark plug replacement is a relatively easy job for most people, but it can be dangerous if done incorrectly.