When it comes to parenting, everyone has an opinion, especially when it pertains to children that don't belong to them and most of it is unsolicited. Probably the most frustrating thing about unsolicited advice is that half the people you meet tell you one thing while the other half tell you another which can make you feel even more confused about a problem as opposed to helping you solve it. Navigating the world of unsolicited advice can be tricky, especially when its someone close to you whose feelings you don't want to hurt or if there are relationship dynamics that make for an already tense relationship. Everyone loves to share their input so it's doubtful that unsolicited advice about raising kids will ever go away but it is possible to set boundaries and communicate with the people giving it to help lessen it and the effect that it has on you.
When receiving unsolicited advice, an important question to ask is "What's their motive?" - As a new parent, you're already stressed out, overwhelmed and a lack of confidence may make you a little more defensive than normal. In my experiences, there are definitely people that are trying to be shady when giving advice, but most people are just trying to help. It may be annoying because your situation is completely different from your own, but it's natural for people to assume that if something worked for them, it will work for you as well.
Don't take it personally - Sometimes unsolicited advice can feel like an attack on your parenting skills. This is especially true if someone is suggesting that you do something that you've already ruled out or tried and can feel like an insult to your intelligence. Chances are though that the person has no clue that you've already tried it or ruled it out. Its still frustrating that they didn't even take the time to find out what you've already done before making recommendations but it should be looked at as a harmless irritation and not an underhanded way of them questioning your capabilities to parent.
It never hurts to listen - Just because advice is given, doesn't mean that it has to be taken and there's nothing wrong with listening to what someone has to say; Assuming you haven't tried it already or it doesn't go against your parenting beliefs. In my parenting journey and in life, I've found that sometimes, I shoot down a solution before trying it because I've already decided that it won't work in my head. There have been many times that I've tried a solution that I didn't think would work, only to find out that it actually did!
Tell them how they can help you - Sometimes when advice is given because someone is trying to be helpful and you may be able to ward off unsolicited advice by proactively letting them know how they actually can help you. It's hard to ask for help but doing so can be a win-win for you. You not only will slow down some of the unasked offers of advice, but get some much needed assistance as well.
Be mindful of who you vent to - You know the people that you're related to or friends with and you know who's more likely to listen to you vent and give you a comforting hug versus who's going to try to help you solve your problem. If you're in a mood to just vent and don't necessarily want advice, then avoid talking to those people about your what's bothering you. This isn't to say that you should keep your feelings bottled up, just stay clear of them in situations where you know that their input will do more harm than good.
Talk openly with your friends and family about the issue - Sometimes when excess unsolicited advice is being given, it's because healthy boundaries haven't been set. The person giving you advice may have no clue that they're annoying you. In a polite but firm way, you can let them know that when you want their advice, you'll ask for it. Chances are that if someone is constantly giving you unsolicited advice, they're not going to have and epiphany on their own that causes them to stop doing it and being direct is the best way to go about stopping them from doing so. The earlier you're able to do this, the more likely you are to avoid a blow up down the road when you've reached your limit with them.