functions.php
メタ情報の削除
//feed_links
remove_action('wp_head', 'feed_links', 2);
//feed_links_extra
remove_action('wp_head', 'feed_links_extra', 3);
//wp_print_styles
remove_action('wp_head', 'wp_print_styles', 8);
//wp_print_head_scripts
remove_action('wp_head', 'wp_print_head_scripts', 9);
//adjacent_posts_rel_link_wp_head
remove_action('wp_head', 'adjacent_posts_rel_link_wp_head',10);
//wp_shortlink_wp_head
remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0);
//rsd_link
remove_action('wp_head', 'rsd_link');
//wlwmanifest_link
remove_action('wp_head', 'wlwmanifest_link');
//wp_generator
remove_action('wp_head', 'wp_generator');
//print_emoji_detection_script
remove_action('wp_head', 'print_emoji_detection_script', 7 );
//print_emoji_styles
remove_action('wp_print_styles', 'print_emoji_styles' );
CSSやJSの?ver=~の削除
function remove_wp_ver_css_js( $src ) {
if ( strpos( $src, 'ver=' ) )
$src = remove_query_arg( 'ver', $src );
return $src;
}
add_filter( 'style_loader_src', 'remove_wp_ver_css_js', 9999 );
add_filter( 'script_loader_src', 'remove_wp_ver_css_js', 9999 );
All in One SEO Packのprev/nextリンク削除
add_filter( 'aioseop_prev_link', '__return_empty_string' );
add_filter( 'aioseop_next_link', '__return_empty_string' );
コメント