0

I want to add my own <meta /> tag inside the <head></head> container on every page or post within the loop().

Is that possible?

What hook(s) should I use for that?

4

to hook in the <head> you would use wp_head. You can read the documentation here.

add_action( 'wp_head', 'meta_example' );

function meta_example() {

    echo '<meta name="description" content="Meta Description for this Page." />';

} // End meta_example()

This assumes that your theme has <?php wp_head(); ?> in the <head>.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy