Always make sure that you have it well known that you want your ceremony or entire wedding to be "unplugged"!! Throw a note in your invitations to all the guests, post signs at your wedding, put it on your website, and even put it in your ceremony program.
If you asked your guests to stay off their phones during your ceremony and then spot a few guests misbehaving once you get your photos back there isn't really anything you can do guest wise. Talk with your photographer to see if there is a chance the phones can be edited out. If not then crop the photo creatively to put the focus on you and not the phones or find other angles of the photo that doesn't show the phones as well!!
Did you request that your guests not share anything on social media? If you spot them online shoot them a quick call or text and politely ask them to remove the photos. Let them know that you just want the event to be private and you are so happy that they were able to attend but these are your wishes and fair enough because it was your wedding day after all!!