Shafter is a city in Kern County, California, United States. It is located 18 miles (29 km) west-northwest of Bakersfield. The population was 16,988 at the 2010 census, up from 12,736 at the 2000 census.
The city is located along State Route 43. Suburbs of Shafter include Myricks Corner, North Shafter, Smith's Corner, and Thomas Lane.