Go to Gmail Settings by clicking the gear ion
on the top left
- Take Filters tab
- On the page bottom click Create new filter
- In the From filter type facebookmail.com
- Click Create filter with this search » and in the next screen check skip the inbox and Apply the label and create a label by typing a label name like Facebook mails and click the Create button
- Select the Checkbox Also apply filter to # matching conversations and click the Create filter button.
Repeat the above step with m.facebook.com
You can do these steps for: foursquare.com, dropbox.com,
twitter.com, linkedin.com, soundcloudmail.com