The whooping cough vaccine is offered to all pregnant women between 16 and 32 weeks of pregnancy. You can have the vaccine after 32 weeks of pregnancy up until the time your baby is born. However, it may be less effective if you have it later in your pregnancy.