WordPress : 不用なメタ・タグを表示しない


WordPress標準で表示されるhtmlメタ・タグのうち、表示したくないものは非表示にします。

以下をfunctions.phpに加えます。

remove_action( 'wp_head', 'wp_generator' ); 
remove_action( 'wp_head', 'wlwmanifest_link' );  
/*** 以下はお好みで・・・ ***/
/***
remove_action( 'wp_head', 'rel_canonical');  
remove_action( 'wp_head', 'index_rel_link' );  
remove_action( 'wp_head', 'feed_links_extra', 3 ); 
remove_action( 'wp_head', 'feed_links', 2 );
remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 );
remove_action( 'wp_head', 'start_post_rel_link', 10, 0 );
remove_action( 'wp_head', 'adjacent_posts_rel_link', 10, 0 );
remove_action( 'wp_head','adjacent_posts_rel_link_wp_head',10);

add_filter('xmlrpc_enabled','__return_false'); 
remove_action( 'wp_head', 'rsd_link' );  

*****/
タグ:
カテゴリー: WordPress

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

*

次のHTML タグと属性が使えます: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

カテゴリー