Methods for alleviating physical pain are increasingly found to attenuate social pain. Recent evidence suggests that swearing may attenuate sensitivity to physical pain. This study examined whether swearing similarly attenuates two consequences of social distress: social pain and exclusion‐induced hyperalgesia. Sixty‐two people wrote about an autobiographical experience of exclusion or inclusion. Then they repeated a swear or neutral word for 2 minutes followed by measures of social and physical pain. Excluded non‐swearers reported feeling more social pain and greater sensitivity to physical pain compared with included non‐swearers. Excluded swearers reported less social pain than excluded non‐swearers and no heightened sensitivity to physical pain. The findings suggest that social and physical pain are functionally similar and that swearing attenuates social pain.