While some theme frameworks like Genesis have a built-in option for quickly adding code and scripts to your WordPress header or footer, we here at WPBeginner have worked on numerous sites and custom themes where this functionality doesn’t exist. Most users, however, will certainly want to add some sort of meta information or Google Analytics to their WordPress blog at some point.
To solve this problem, and empower the users, we use a custom plugin on our sites called Insert Headers and Footers for WordPress. Not only is it extremely simple and easy to use without a bunch of confusing options, the biggest advantage is that instead of having to use a dozen different plugins to add various scripts and meta tags to your header or footer you can just add them all in one spot. In this tutorial we are going to show you how to insert code to you WordPress header or footer using this simple plugin.
First, download and install Insert Headers and Footers for WordPress. Now go to Settings » Insert Headers and Footers.

Here you see two text boxes where you can add your code. Simply copy and paste any meta information, scripts, Google Analytics, etc. and click “save settings”. This code will now be output to either your header or you footer.
Download Insert Headers and Footers for WordPress






I did this and I see that the script appears in the footer of my page. However, Google Analytics still says that the tracking is not installed. Please help!
Are you using a caching plugin? If so, can you please empty your cache?
I get Notice: wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or init hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in C:\tools\xampp\htdocs\wpfrontier\wp-includes\functions.php on line 2758
when I use it to insert google font code in header
This plugin is mainly created for analytics script, or meta information. This is not meant to be used for inserting jQuery or other design elements like those. The purpose was to allow users to easily add tags in their head or footer without editing theme files.
I have tried to add FB meta tags in header with this plugin, but it didn’t work. The idea is good, though.
If you are trying to add dynamic PHP code in this plugin, then it would not work. This plugin does not execute PHP. It is mainly for inserting static meta tags.
Well, I don’t know if those tags are dynamic or static
I tried the standard Facebook tags such as this:
<meta property="og:url" content="”/>
<meta property="og:title" content="” />
<meta property="og:description" content="ID)); ?>” />
<meta property="og:image" content="ID ) ) ?>” />
Can you tell me if this plugin is good for this purpose? Thanks
No it is not good for that. Because the URL, the Title, and Description all have the PHP tag which is dynamic.
a great plugin but my custom theme already has this option! will bookmark this post in case i change my themes.
Yeah it’s main purpose is to keep you from being theme dependent. Often people place their Analytics codes etc in their theme’s footer scripts area like this. Then they forgot about it when they switch themes. This causes them to lose analytics data for number of days.