Add verification tags, tracking scripts or chat widgets to every page, in the head or just before the closing body tag.
// Inside <head>: verification meta tags, preconnects, small inline styles.
add_action( 'wp_head', function (): void {
?>
<meta name="google-site-verification" content="your-verification-code">
<?php
}, 1 );
// Before </body>: analytics, chat widgets and other scripts that can load last.
add_action( 'wp_footer', function (): void {
?>
<!-- Paste the script your service gave you here. -->
<?php
}, 100 );
Always add PHP to a staging site first, or have FTP or file manager access ready, so you can undo it if something goes wrong.
Search Console verification, analytics tags and chat widgets all come with a “paste this into your site” snippet. Adding it with WordPress hooks keeps it in place through theme updates and makes it easy to remove later.
WordPress prints the wp_head action inside <head> and wp_footer just before </body>. Closing the PHP tag inside each function lets you paste HTML exactly as your service provides it.
Priority 1 puts the head code near the top, which verification tools expect. Priority 100 puts footer code after most other scripts.
View your page source. Your meta tag should appear near the top of the head, and footer code just before </body>.