Skip to main content
Commonmark migration
Source Link

##Remove superfluous info and HTML within the <head> tag

Remove superfluous info and HTML within the <head> tag

// remove unnecessary header info add_action( 'init', 'remove_header_info' ); function remove_header_info() { remove_action( 'wp_head', 'rsd_link' ); remove_action( 'wp_head', 'wlwmanifest_link' ); remove_action( 'wp_head', 'wp_generator' ); remove_action( 'wp_head', 'start_post_rel_link' ); remove_action( 'wp_head', 'index_rel_link' ); remove_action( 'wp_head', 'adjacent_posts_rel_link' ); // for WordPress < 3.0 remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head' ); // for WordPress >= 3.0 } // remove extra CSS that 'Recent Comments' widget injects add_action( 'widgets_init', 'remove_recent_comments_style' ); function remove_recent_comments_style() { global $wp_widget_factory; remove_action( 'wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) ); } 

##Remove superfluous info and HTML within the <head> tag

// remove unnecessary header info add_action( 'init', 'remove_header_info' ); function remove_header_info() { remove_action( 'wp_head', 'rsd_link' ); remove_action( 'wp_head', 'wlwmanifest_link' ); remove_action( 'wp_head', 'wp_generator' ); remove_action( 'wp_head', 'start_post_rel_link' ); remove_action( 'wp_head', 'index_rel_link' ); remove_action( 'wp_head', 'adjacent_posts_rel_link' ); // for WordPress < 3.0 remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head' ); // for WordPress >= 3.0 } // remove extra CSS that 'Recent Comments' widget injects add_action( 'widgets_init', 'remove_recent_comments_style' ); function remove_recent_comments_style() { global $wp_widget_factory; remove_action( 'wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) ); } 

Remove superfluous info and HTML within the <head> tag

// remove unnecessary header info add_action( 'init', 'remove_header_info' ); function remove_header_info() { remove_action( 'wp_head', 'rsd_link' ); remove_action( 'wp_head', 'wlwmanifest_link' ); remove_action( 'wp_head', 'wp_generator' ); remove_action( 'wp_head', 'start_post_rel_link' ); remove_action( 'wp_head', 'index_rel_link' ); remove_action( 'wp_head', 'adjacent_posts_rel_link' ); // for WordPress < 3.0 remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head' ); // for WordPress >= 3.0 } // remove extra CSS that 'Recent Comments' widget injects add_action( 'widgets_init', 'remove_recent_comments_style' ); function remove_recent_comments_style() { global $wp_widget_factory; remove_action( 'wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) ); } 
improv to Codex' Coding Standards, and toscho's argumentation on order of add_action & functions
Source Link
Volker E.
  • 229
  • 3
  • 16

##Remove superfluous info and HTML within the <head> tag

// remove unnecessary header info add_action( 'init', 'remove_header_info' ); function remove_header_info() { remove_action( 'wp_head', 'rsd_link' ); remove_action( 'wp_head', 'wlwmanifest_link' ); remove_action( 'wp_head', 'wp_generator' ); remove_action( 'wp_head', 'start_post_rel_link' ); remove_action( 'wp_head', 'index_rel_link' ); remove_action( 'wp_head', 'adjacent_posts_rel_link' ); // for WordPress <  3.0 remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head' ); // for WordPress >= 3.0 } add_action('init', 'remove_header_info');  // remove extra CSS that 'Recent Comments' widget injects add_action( 'widgets_init', 'remove_recent_comments_style' ); function remove_recent_comments_style() { global $wp_widget_factory; remove_action( 'wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) ); } add_action('widgets_init', 'remove_recent_comments_style'); 

##Remove superfluous info and HTML within the <head> tag

// remove unnecessary header info function remove_header_info() { remove_action('wp_head', 'rsd_link'); remove_action('wp_head', 'wlwmanifest_link'); remove_action('wp_head', 'wp_generator'); remove_action('wp_head', 'start_post_rel_link'); remove_action('wp_head', 'index_rel_link'); remove_action('wp_head', 'adjacent_posts_rel_link'); // for WordPress <  3.0 remove_action('wp_head', 'adjacent_posts_rel_link_wp_head'); // for WordPress >= 3.0 } add_action('init', 'remove_header_info');  // remove extra CSS that 'Recent Comments' widget injects function remove_recent_comments_style() { global $wp_widget_factory; remove_action('wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' )); } add_action('widgets_init', 'remove_recent_comments_style'); 

##Remove superfluous info and HTML within the <head> tag

// remove unnecessary header info add_action( 'init', 'remove_header_info' ); function remove_header_info() { remove_action( 'wp_head', 'rsd_link' ); remove_action( 'wp_head', 'wlwmanifest_link' ); remove_action( 'wp_head', 'wp_generator' ); remove_action( 'wp_head', 'start_post_rel_link' ); remove_action( 'wp_head', 'index_rel_link' ); remove_action( 'wp_head', 'adjacent_posts_rel_link' ); // for WordPress < 3.0 remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head' ); // for WordPress >= 3.0 } // remove extra CSS that 'Recent Comments' widget injects add_action( 'widgets_init', 'remove_recent_comments_style' ); function remove_recent_comments_style() { global $wp_widget_factory; remove_action( 'wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) ); } 
updated, improved formatting
Source Link
tfrommen
  • 9.2k
  • 7
  • 40
  • 59

##Remove superfluous info and HTML within the <head> tag

// remove unncessaryunnecessary header info function remove_header_info() { remove_action('wp_head', 'rsd_link'); remove_action('wp_head', 'wlwmanifest_link'); remove_action('wp_head', 'wp_generator'); remove_action('wp_head', 'start_post_rel_link'); remove_action('wp_head', 'index_rel_link'); remove_action('wp_head', 'adjacent_posts_rel_link'); // for WordPress < 3.0 remove_action('wp_head', 'adjacent_posts_rel_link_wp_head'); // for WordPress >= 3.0 } add_action('init', 'remove_header_info'); // remove extra cssCSS that recent'Recent commentsComments' widget injects function remove_recent_comments_style() { global $wp_widget_factory; remove_action('wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'],  'recent_comments_style' )); } add_action('widgets_init', 'remove_recent_comments_style'); 

##Remove superfluous info and HTML within the <head> tag

// remove unncessary header info function remove_header_info() { remove_action('wp_head', 'rsd_link'); remove_action('wp_head', 'wlwmanifest_link'); remove_action('wp_head', 'wp_generator'); remove_action('wp_head', 'start_post_rel_link'); remove_action('wp_head', 'index_rel_link'); remove_action('wp_head', 'adjacent_posts_rel_link'); } add_action('init', 'remove_header_info'); // remove extra css that recent comments widget injects function remove_recent_comments_style() { global $wp_widget_factory; remove_action('wp_head', array($wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style')); } add_action('widgets_init', 'remove_recent_comments_style'); 

##Remove superfluous info and HTML within the <head> tag

// remove unnecessary header info function remove_header_info() { remove_action('wp_head', 'rsd_link'); remove_action('wp_head', 'wlwmanifest_link'); remove_action('wp_head', 'wp_generator'); remove_action('wp_head', 'start_post_rel_link'); remove_action('wp_head', 'index_rel_link'); remove_action('wp_head', 'adjacent_posts_rel_link'); // for WordPress < 3.0 remove_action('wp_head', 'adjacent_posts_rel_link_wp_head'); // for WordPress >= 3.0 } add_action('init', 'remove_header_info'); // remove extra CSS that 'Recent Comments' widget injects function remove_recent_comments_style() { global $wp_widget_factory; remove_action('wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'],  'recent_comments_style' )); } add_action('widgets_init', 'remove_recent_comments_style'); 
deleted 18 characters in body
Source Link
NetConstructor.com
  • 4.4k
  • 18
  • 72
  • 83
Loading
Source Link
Andrew Ryno
Andrew Ryno
Loading
Post Made Community Wiki