My DD was bridesmaid at her uncles wedding.
She was 2 1/2 at the time. At the church her and her cousin (pageboy) were being little terrors so I took them outside, then we went for the meal and she had an accident so I called my friend who was happy to have her overnight at short notice and took her there when everyone else was doing the speeches etc.
The Bride and Groom were totally understanding and she had been bridesmaid!
I think tbh, if a child is invited, it's down to the parents, afetr all they are who will have to look after them, if a child isn't invited it's down to the bride and groom.