Use code PERFMATTERS for an additional 10% off!

WordPress Add Code to Header and Footer

There are times when you might need to add custom code to your WordPress site’s header (head) or footer. A good example would be with your favicon. We always recommend loading your favicon from your CDN, and with most themes, you will need to manually specify this.

On our site, we load the following in our header.

<link rel="icon" href="https://cdn.perfmatters.io/wp-content/uploads/2017/08/favicon.png" type="image/x-icon" />

With the Perfmatters plugin, you can easily drop any custom code into both your header and footer.

Add Code to WordPress Header (Head)

You can add code to your WordPress header by going to “Settings → Perfmatters → Extras” in your WordPress admin dashboard.

Scroll down to “Add Header Code.”

WordPress add code to head
WordPress add code to head

Code added here will be printed in the <head> </head> section on every page of your website.

You can add code to your WordPress footer by going to “Settings → Perfmatters → Extras” in your WordPress admin dashboard.

Scroll down to “Add Footer Code.”

WordPress add code to footer
WordPress add code to footer

Code added here will be printed above the closing </body> tag on every page of your website.

Was this article helpful?

Related Articles