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 a WordPress Plugin

  1. Navigate to WordPress dashboard Extensions > Add
  2. Search for “Disable Emojis”
  3. Install and activate the plugin
  4. The plugin automatically deactivates Twemoji integration

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