Back to Support Plugins and Integrations Add Code to Headers

Add Code to Headers

Many services, such as Google AdSense and Mailchimp, ask you to add code to the site header in order to verify your website, add content, or integrate some features. This guide will show you how to place this code on your website.

Integrated Services

If you wish to verify your site or domain with Google Search Console, Bing, Pinterest, Yandex, or Facebook Business, you do not need to follow the steps in this guide. Instead, visit Tools → Marketing → Traffic (or Jetpack → Settings → Traffic if using WP-Admin) and scroll down to “Site verification” to access special tools to safely add the code without manipulating site files directly.

Adding Code to Headers.php

This section of the guide applies to sites with the WordPress.com Creator or Entrepreneur plan. If your site has one of our legacy plans, this feature is available on the Pro plan.

To integrate your site with many popular services, you’ll often be asked to add some code to your site’s header, between <head> and </head> tags, or in the theme editor or HTML header. The code helps that service recognize and communicate with your website. They ask you to add the code to the header because the code will be present on every page of your site.

The instructions from that service may vary, but the steps below should work in most cases.

To add the code to your website header, take the following steps:

  1. Install and activate the free Insert Headers and Footers plugin by WPCode.
  2. On the left-hand side of your dashboard, navigate to Code SnippetsHeader & Footer.
  3. Paste the code into the Header box and click the “Save Changes” button:
An arrow points to the box to paste the code. A second arrow points to the Save Changes button.
Paste the code into your site header and save your changes

Common Services

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

Was this guide helpful for you?

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

Copied to clipboard!