WordPress4.8のwp_headで出力されるものを削除

カテゴリ: WP関連メモ
wp head

functions.phpに追加する文字列
消える文字列

remove_action("wp_head", "wp_resource_hints", 2);
<link rel="dns-prefetch" href="//s.w.org" />

remove_action("wp_head", "feed_links_extra", 3);
<link rel="alternate" type="application/rss+xml" title="test » test のコメントのフィード"・・・・・・>

remove_action("wp_head", "print_emoji_detection_script", 7);
<script type="text/javascript">window._wpemojiSettings =・・・・・・</script>

remove_action("wp_print_styles", "print_emoji_styles");
<style type="text/css">img.wp-smiley・・・・・・</style>

remove_action("template_redirect", "_wp_admin_bar_init", 0);
<link rel="stylesheet" id="dashicons-css"・・・・・・>
<link rel="stylesheet" id="admin-bar-css"・・・・・・>

remove_action("wp_head","rest_output_link_wp_head");
<link rel="https://api.w.org/"・・・・・・>

remove_action("wp_head", "rsd_link");
<link rel="EditURI" type="application/rsd+xml" title="RSD"・・・・・・>

remove_action("wp_head", "wlwmanifest_link");
<link rel="wlwmanifest" type="application/wlwmanifest+xml"・・・・・・>

remove_action("wp_head", "adjacent_posts_rel_link_wp_head");
<link rel="prev"・・・・・・>
<link rel="next"・・・・・・>

remove_action("wp_head", "wp_generator");
<meta name="generator" content="WordPress 4.8.1" />

remove_action("wp_head", "rel_canonical");
<link rel="canonical"・・・・・・>

remove_action("wp_head", "wp_shortlink_wp_head", 10, 0);
<link rel="shortlink"・・・・・・>

remove_action("wp_head", "wp_oembed_add_discovery_links");
<link rel="alternate" type="application/json+oembed"・・・・・>
<link rel="alternate" type="text/xml+oembed"・・・・・>