Add Meta Tag and JavaScript into Header or Footer of WordPress

There are many cases you need to insert some lines of code into header or body of your WordPress‘s template.

What you can place into those areas:

  • Add meta tag to verify an external service like Google Webmaster Tool.
  • Add Google Analytics script.
  • A JavaScript script or import a script library.
  • Custom stylesheet.

Creating a module for that purpose is overkill, so we will use a plugin.

Header and Footer Scripts

This plugin uses wp_head and wp_footer hooks and inserts your codes to respective section of the WordPress template.

The setting page has 2 fields for user to input scripts in header or footer. It also offers an option to input custom script to individual post or page.

Download plugin

Insert Headers and Footers

Insert Headers and Footers is also a simple plugin to insert code like Google Analytics, custom CSS, Facebook Pixel, and more to header and footer sections.

While the previous plugin allows script setting in individual post , this one allows to add content to beginning of the body tag.

It can be downloaded here.

Leave a Comment

Your email address will not be published. Required fields are marked *

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.