wp_head -­­ WordPress Action Hook

wp_head is a WordPress Action Hook that triggers in wp_head() function. wp_head() function is normally added between HTML <head> tag. So anything added in this hook triggers inside <head> tag like Google Analytics code etc.

Basic Use

add_action( 'wp_head', function() {
    echo '<!-- Add this comment between <head></head> tag -->';
} );

Source

do_action( 'wp_head' );

Leave a Reply

Your email address will not be published. Required fields are marked *