Self employed women do not have the right to Statutory Maternity Pay (SMP) unless you are also an employee (see below). Instead you will have to claim Maternity Allowance (MA). To qualify for this you must have been employed or self employed for any 26 weeks in the 66 weeks leading up to the week your baby is due. These weeks do not have to be in an unbroken block, and you could use some time where you were employed and some where you were self employed.
You also need to have 13 weeks where you have either paid 2 National Insurance contributions, or held a Certificate of Small Earnings Exception, or had earnings from employed work.
If you have been paying Class 2 NI, you will be treated as having enough earnings to qualify for maximum MA. If you had a Certificate of Small Earnings Exception, you will be treated as having earned £30 per week, and so will be entitled to £27 per week Maternity Allowance.
If you own a limited company and pay yourself a salary through PAYE from the company, you could qualify for SMP as an employee, provided you meet the usual test. Call the HMRC employer’s helpline on 08457 143 143. You will find more information on the Revenue website.