In addition to coverage of Font Scripts, there are concerns about data protection when using the Twemoji Font Script. This guide walks 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, it aims to provide emojis with uniform design and appearance across devices and operating systems.

Twemoji and WordPress

Since WordPress version 4.2 (April 2015), Twemoji has been included by default. However, users may prefer disabling it for performance optimization, preference for native device emojis, or different visual styles.

Data Protection Issues with Twemoji

Twemoji’s default integration means emojis load from X’s servers, raising several concerns:

  1. User tracking: Emoji requests to Twitter’s servers potentially enable data collection on visitors, including IP addresses and pages visited.
  2. nFADP compliance: Swiss company websites sending user IP addresses to X’s US-based servers without consent violates nFADP regulations.
  3. GDPR Compliance: EU-based websites or those with European visitors face strict obligations regarding personal data collection and processing under GDPR.

How to Remove Twemoji from WordPress

Method 1: Using the biskoui WordPress plugin

The simplest approach is our biskoui WordPress plugin, available free from the official WordPress plugin directory. It includes a dedicated option that stops Twemoji from loading, without touching a single line of code.

  1. Install and activate the biskoui plugin

    • Go to your WordPress dashboard.
    • Click Plugins > Add Plugin.
    • Search for “biskoui”.
    • Install and activate the plugin.
  2. Enable the Twemoji option

    • Click the biskoui menu in the left-hand column.
    • Tick the “Stop loading Twemoji on this site” option.
    • Click Save Changes.
  3. Check that emojis are disabled
    Visit a page or post on your site containing emojis: they should now render using the device’s native style, with no request sent to X’s servers.

The same plugin also lets you install the biskoui consent banner on your site. See our dedicated installation guide.

Method 2: Adding Code to functions.php

  1. Go to Appearance > Theme Editor in your WordPress dashboard
  2. Select the functions.php file of your current theme
  3. Add the following code at the end of the file:
/**
 * 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' );
    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();
    }
}

Verify emoji deactivation by checking your site pages.

Conclusion

Disabling Twemoji helps address nFADP and GDPR compliance issues while reverting to native device emojis, potentially improving performance and protecting user privacy.

If you need further assistance, our support team is available at support@biskoui.ch