{"id":151,"date":"2017-06-28T12:40:42","date_gmt":"2017-06-28T10:40:42","guid":{"rendered":"https:\/\/laikalaikacoding.wordpress.com\/?p=151"},"modified":"2017-06-28T12:40:42","modified_gmt":"2017-06-28T10:40:42","slug":"removing-emoji-emoticon-support-from-wordpress","status":"publish","type":"post","link":"https:\/\/voneff.de\/en\/removing-emoji-emoticon-support-from-wordpress\/","title":{"rendered":"Removing Emoji &#038; Emoticon Support from WordPress ;-)"},"content":{"rendered":"<p><a href=\"https:\/\/wordpress.stackexchange.com\/questions\/185577\/disable-emojicons-introduced-with-wp-4-2\">Apparently<\/a>, since its 4.2 update WordPress automatically converts text based smilies like \u201c;-)\u201d into emoji images like \ud83d\ude09<\/p>\n<p>Besides being problematic regarding loading times (the script is loaded wether you use emojis or not) \u2013 the images might not fit the overall asthetics and design of the site while a text-only smiley might be preferred.<\/p>\n<p>I started out by using WordPress hooks as described <a href=\"http:\/\/www.hongkiat.com\/blog\/disable-wordpress-emoticons\/\">here<\/a>:<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\nremove_action(&#039;wp_head&#039;, &#039;print_emoji_detection_script&#039;, 7);\nremove_action(&#039;wp_print_styles&#039;, &#039;print_emoji_styles&#039;);\n<\/pre>\n<p>\u2026and amending this as described <a href=\"https:\/\/wordpress.stackexchange.com\/questions\/185577\/disable-emojicons-introduced-with-wp-4-2\">here<\/a>:<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\nfunction disable_wp_emojicons() {\n\n  \/\/ all actions related to emojis\n  remove_action( &#039;admin_print_styles&#039;, &#039;print_emoji_styles&#039; );\n  remove_action( &#039;wp_head&#039;, &#039;print_emoji_detection_script&#039;, 7 );\n  remove_action( &#039;admin_print_scripts&#039;, &#039;print_emoji_detection_script&#039; );\n  remove_action( &#039;wp_print_styles&#039;, &#039;print_emoji_styles&#039; );\n  remove_filter( &#039;wp_mail&#039;, &#039;wp_staticize_emoji_for_email&#039; );\n  remove_filter( &#039;the_content_feed&#039;, &#039;wp_staticize_emoji&#039; );\n  remove_filter( &#039;comment_text_rss&#039;, &#039;wp_staticize_emoji&#039; );\n\n  \/\/ filter to remove TinyMCE emojis\n  add_filter( &#039;tiny_mce_plugins&#039;, &#039;disable_emojicons_tinymce&#039; );\n}\nadd_action( &#039;init&#039;, &#039;disable_wp_emojicons&#039; );\n\n  \/\/ disable TinyMCE emojicons\nfunction disable_emojicons_tinymce( $plugins ) {\n  if ( is_array( $plugins ) ) {\n    return array_diff( $plugins, array( &#039;wpemoji&#039; ) );\n  } else {\n    return array();\n  }\n}\n\n  \/\/ remove the DNS prefetch \t\nadd_filter( &#039;emoji_svg_url&#039;, &#039;__return_false&#039; );\n<\/pre>\n<p>But this did not turn my text smiley back into plain text.<\/p>\n<p>Then I discovered the plugin \u201c<a href=\"https:\/\/wordpress.org\/plugins\/keep-emoticons-as-text\/\">Keep Emoticons as Text<\/a>\u201d which does the trick with a single line of code:<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\nadd_filter( &#039;option_use_smilies&#039;, &#039;__return_false&#039; );\n<\/pre>\n<p>You can easily put all above and this last line in the functions.php of your child theme \u2013 or, even better, in your own functional plugin. And you\u2019re done \ud83d\ude09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Apparently, since its 4.2 update WordPress automatically converts text based smilies like \u201c;-)\u201d into emoji images like \ud83d\ude09 Besides being problematic regarding loading&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","_seopress_robots_follow":"","_seopress_robots_imageindex":"","_seopress_robots_snippet":"","_seopress_robots_primary_cat":"","_seopress_robots_breadcrumbs":"","_seopress_robots_freeze_modified_date":"","_seopress_robots_custom_modified_date":"","_seopress_robots_canonical":"","_seopress_social_fb_title":"","_seopress_social_fb_desc":"","_seopress_social_fb_img":"","_seopress_social_fb_img_attachment_id":0,"_seopress_social_fb_img_width":0,"_seopress_social_fb_img_height":0,"_seopress_social_twitter_title":"","_seopress_social_twitter_desc":"","_seopress_social_twitter_img":"","_seopress_social_twitter_img_attachment_id":0,"_seopress_social_twitter_img_width":0,"_seopress_social_twitter_img_height":0,"_seopress_redirections_value":"","_seopress_redirections_enabled":"","_seopress_redirections_enabled_regex":"","_seopress_redirections_logged_status":"","_seopress_redirections_param":"","_seopress_redirections_type":0,"_seopress_analysis_target_kw":"","_seopress_news_disabled":"","_seopress_video_disabled":"","_seopress_video":[],"_seopress_pro_schemas_manual":[],"_seopress_pro_rich_snippets_disable_all":"","_seopress_pro_rich_snippets_disable":[],"_seopress_pro_schemas":[],"wpf_show_in_dewp_planet_feed":false,"webmentions_disabled_pings":false,"webmentions_disabled":false,"footnotes":""},"categories":[3],"tags":[43,44,88,91,106,107,128],"class_list":["post-151","post","type-post","status-publish","format-standard","hentry","category-code-is-poetry","tag-emoji","tag-emoticon","tag-php","tag-plugin","tag-smiley","tag-smilies","tag-wordpress"],"acf":[],"_links":{"self":[{"href":"https:\/\/voneff.de\/en\/wp-json\/wp\/v2\/posts\/151","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/voneff.de\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/voneff.de\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/voneff.de\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/voneff.de\/en\/wp-json\/wp\/v2\/comments?post=151"}],"version-history":[{"count":0,"href":"https:\/\/voneff.de\/en\/wp-json\/wp\/v2\/posts\/151\/revisions"}],"wp:attachment":[{"href":"https:\/\/voneff.de\/en\/wp-json\/wp\/v2\/media?parent=151"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/voneff.de\/en\/wp-json\/wp\/v2\/categories?post=151"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/voneff.de\/en\/wp-json\/wp\/v2\/tags?post=151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}