Guide: Remove Twemoji from your WordPress site

Introduction

In addition to our article on Fonts Scripts, ihere are concerns about data protection when using the Twemoji Font Script.
In this guide, we’ll walk you through the steps necessary to remove Twemoji from your WordPress site.

What is Twemoji?

Twemoji is a Font Script project developed by X (formerly Twitter) that offers a comprehensive set of emojis compatible with various platforms.
Launched in 2014, Twemoji aims to provide emojis that are uniform in design and appearance, regardless of the device or operating system used.

Twemoji and WordPress

Few know it, but since version 4.2, released in April 2015, WordPress has included Twemoji by default.
However, some users may prefer to disable Twemoji for a variety of reasons, such as performance optimization, preference for native device emojis or the visual style of emojis.

Data protection issues with Twemoji

Twemoji’s default integration in WordPress means that emojis are loaded from X’s servers (e.g. Twitter).
This may raise data protection and privacy concerns:

  1. User tracking
    When Twemoji emojis are loaded, a request is sent to Twitter’s servers.
    This can potentially enable Twitter to collect data on your site’s users, such as their IP addresses and the pages they visit.

  2. nFADP compliance
    For Swiss company websites, the use of Twemoji violates the nFADP, as the user’s IP address is sent to X’s US-based servers (e.g. Twitter) without prior consent. Moreover, it will be very difficult to invoke a legitimate interest for the use of this type of service, as it is not crucial.

  3. GDPR Compliance
    For websites based in the EU or with European visitors, the General Data Protection Regulation (GDPR) imposes strict obligations regarding the collection and processing of personal data. Using Twemoji can complicate GDPR compliance, as it involves transferring data to a third party (Twitter).
For these reasons, you’ll need to disable Twemoji on your WordPress site to comply with the law.

How to remove Twemoji from WordPress

Method 1: Using a WordPress Plugin

One of the easiest ways to disable Twemoji is to use a plugin.
Here’s how:

  1. Install and activate the Disable Emojis plugin
    • Go to your WordPress dashboard.
    • Click on Extensions > Add.
    • Search for “Disable Emojis”.
    • Install and activate the plugin.
  2. Check emoji deactivation:
    Once the plugin has been activated, it will automatically deactivate Twemoji integration.
    You can check by visiting a page or article on your site containing emojis to see if they now appear using the device’s native style.

Method 2: Adding code to functions.php

If you prefer not to use a plugin, you can add code to your functions.php file.
Follow these steps:

Please note that this method is more advanced.
Modifying functions.php is for advanced users only.

  1. Go to functions.php
    • In your WordPress dashboard, go to Appearance > Theme Editor.
    • Select the file functions.php file of your current theme.
  2. Add code to disable Twemoji
    Copy and paste the following code at the end of your file functions.php :
				
					/**
 * Disable the emoji's
 */
function disable_emojis() {
	remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
	remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
	remove_action( 'wp_print_styles', 'print_emoji_styles' );
	remove_action( 'admin_print_styles', 'print_emoji_styles' );	
	remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
	remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );	
	remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
	
	// Remove from TinyMCE
	add_filter( 'tiny_mce_plugins', 'disable_emojis_tinymce' );
}
add_action( 'init', 'disable_emojis' );

/**
 * Filter out the tinymce emoji plugin.
 */
function disable_emojis_tinymce( $plugins ) {
	if ( is_array( $plugins ) ) {
		return array_diff( $plugins, array( 'wpemoji' ) );
	} else {
		return array();
	}
}
				
			

3. Check emoji deactivation:
Once you’ve added the code, you can check by visiting a page or article on your site containing emojis to see if they now appear using the device’s native style.

Conclusion

Using Font Scripts like Twemoji involves nFADP and GDPR compliance issues.

Disabling Twemoji on your WordPress site is easy and can be achieved in a variety of ways, depending on your preferences.
Whether you choose to use a plugin or add code directly, these methods will allow you to revert to native device emojis, potentially improve your site’s performance and better protect your users’ privacy.

Need help removing Twemoji from your WordPress site?

Our support team is available at the following address address below: support@biskoui.ch