The NHS recommends breastfeeding your baby exclusively (feeding them breast milk only) for the first six months, but it's completely up to you to decide when you want to bring it to an end - and there's really no right or wrong way to do it.
You can breastfeed for as long as you want, and while the NHS recommends breastfeeding your baby exclusively for the first six months, you shouldn't feel like you cannot continue for longer.
The World Health Organization says: "Exclusive breastfeeding is recommended up to 6 months of age, with continued breastfeeding along with appropriate complementary foods up to two years of age or beyond.".
They note that solid food shouldn't replace breast milk, as there is evidence to suggest breast milk helps a baby's digestive system when processing solid food for the first time.
"Once they are eating solids, your baby will still need to have breast milk or formula as their main drink up to at least their first birthday," recommends the NHS.