Add tags to the section via functions.php

The hook you’re looking for is specifically wp_head which could look something like this:

function theme_xyz_header_metadata() {

    // Post object if needed
    // global $post;

    // Page conditional if needed
    // if( is_page() ){}

  ?>

    <meta name="abc" content="xyz" />

  <?php

}
add_action( 'wp_head', 'theme_xyz_header_metadata' );

I believe in the long run though, since WordPress is so portable, Yoast SEO is probably the most reliable, flexible bet for SEO than something you would do yourself so I would advise against this personally.

Leave a Comment