The suggested new approach above might have a typo 'demoji', which should be correctly written as 'emoji' and also should be .replace_emoji(). See the correct version below: def remove_emojis(text): return emoji.replace_emoji(text, '')