Sometimes we need to add meta tags of google analytics or search console, or even pinterest in header of the WordPress website to prove the ownership of the domain. There are many more such third party services or apps which ask you to add their meta tags to verify website owner. Although there are many plugins available to add header tags, it is better to not to use plugins unnecessarily as they make the website slower.
here are the steps to do it without the help of any plugin:
- Open your theme/functions.php file
- Add the following code and save the file.
function pim_add_meta_tags() { echo '<meta name="meta_name" content="meta_value">'; } add_action('wp_head', 'pim_add_meta_tags');
Make sure you replace the meta_name and meta_value in above script from your meta code.