Genesis Themes

  • Home
  • Genesis Tutorials
  • WP Tutorial
  • Twenty Fifteen Theme
  • Social Media
  • WP Plugins

Remove WordPress Emoji Script and Style

Remove WordPress Emoji:

WordPress 4.2 added emoji support, that means some extra CSS and JS loaded by default to display Emoji. To remove Emoji script in WordPress, install Ryan Hellyer’s Disable Emojis plugin or play with the following code without using WordPress plugin.The main disadvantage of using emoticons in WordPress is negative impact on site load time.

You can easily remove WordPress Emoji script and style, which added in the latest WordPress 4.2 by adding the following code to your current theme's functions.php file.

// Remove emoji support.
function myg_remove_emoji() {
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'admin_print_styles', 'print_emoji_styles' );
remove_action( 'wp_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', 'myg_remove_tinymce_emoji' );
}
add_action( 'init', 'myg_remove_emoji' );

// Filter out the tinymce emoji plugin.

function myg_remove_tinymce_emoji( $plugins ) {

if ( ! is_array( $plugins ) ) {
return array();
}

return array_diff( $plugins, array( 'wpemoji' ) );
}

To check out the actions and filters used in Emoji, open this file /wp-includes/default-filters.php and search for emoji.To remove emoji in WordPress 4.2, we used the functions remove_filter and remove_action

Related Posts

  • How to Disable Emojicons in WordPress 4.2
  • Show one category Posts on Home Page in WordPress 2015 theme
  • How to Combine External JavaScript files in WordPress
  • Top 10 Most Popular Google Adsense Alternatives 2016
  • Display WordPress Popular Posts by Comments Count
  • Disable Disqus Comments on Certain Pages in WordPress
  • How to Display Google Adsense After First Post in WordPress
  • How to Reduce Server Response Time in WordPress
  • How to Enable Gzip Compression in WordPress
  • The Ideal WP Fastest Cache Settings 2016

Bluehost and Siteground Coupons for January 2016.

Best Premium WordPress Themes from TemplateMonster
download wordpress themes from MonsterOne

Categories

  • Blog
  • Blogger
  • Genesis Tutorials
  • Social Media
  • Top Websites
  • Twenty Fifteen WordPress Theme
  • WordPress Plugins
  • WordPress Tutorial