Guides/Plugins and tools/Tools/Add code to headers

Add code to headers

Last reviewed on December 10, 2025

Many services, such as Google AdSense and Mailchimp, require you to add code to your site header to verify your website or integrate features. Adding code to your header ensures it loads on every page of your site. In this guide, you will learn how to add code to your website header.

Use integrated site verification tools

If you want to verify your site with Google Search Console, Bing, Pinterest, Yandex, or Facebook Business, you do not need to follow the steps in this guide. Instead, navigate to Jetpack → Traffic (or Jetpack → Settings → Traffic tab in WP Admin) and scroll to Site verification to add the verification code without editing site files.

To verify your site with Google Analytics, follow these steps to connect to Google Analytics.

Services like Google AdSense, Mailchimp pop-ups, and Meta Pixel do not have integrated tools and require the method described below.

Add code to your site header

This feature is available on sites with the WordPress.com Personal, PremiumBusiness, and Commerce plans. For free sites, upgrade your plan to access this feature.

Many services ask you to add code between your site’s <head> and </head> tags. This code helps the service recognize and communicate with your website.

To add code to your website header or footer, follow these steps:

  1. Install and activate the free Insert Headers and Footers plugin by WPCode.
  2. From your site’s dashboard, navigate to Code Snippets → Header & Footer.
  3. Paste the code into the Header or Footer box.
  4. Click “Save Changes“.
Example header code added to the WPCode interface.
Paste the code into your site header and save your changes.

Services that require header code

The steps above work with any tool that requires you to add code to your site header. Popular services include:

Was this guide helpful for you?

Not quite what you're looking for? Get Help!

Copied to clipboard!