Ever need to add a tracking code to your site, but you don’t want to figure out where to add it in your WordPress theme? That’s where header and footer WordPress plugins come in handy. In this article, you’ll learn about header and footer WordPress plugins.
What is a Header and Footer WordPress plugin?
A header and footer WordPress plugin is designed for you to add small pieces of code to either your header area or footer area of your website.
This method bypasses adding code directly to your theme. If you add it to your theme, you have to remember to add the code back to any new theme you install, or when you update.
There are all sorts of reasons why you need to add code to your website header or footer. These type of codes that you need to add to your header and footer could be:
- Website traffic tracking codes
- Social media remarketing tracking codes
- Website verification codes for various websites
- Code for ad networks
Website traffic tracking codes
Website traffic tracking sites like Google Analytics require you to add their code to your website to help collect data on your visitors’ behavior. With WordPress, you can either use a WordPress Analytics plugin or add the Google Analytics code to the header of your theme, which will place the code in a spot where every post and page can be tracked.
Social media remarketing tracking codes
If you run a business and use Facebook, you most likely will want to take advantage of adding the Facebook Pixel to your website. This tracks your visitors and allows you to utilize Facebook’s Business Suite so you can plan ad campaigns.
Website verification codes for various websites
Sometimes when you add your website to places like Google Search Console or Bing Webmaster Tools, those sites will ask you to place a code that will verify that your website exists and that it is yours.
Code for ad networks
Some ad networks like Google Adsense might need you to add code to your header or footer in order to verify your site, or for tracking purposes.
How can Header and Footer WP plugins benefit you?
A header and footer WordPress plugin can benefit you in a couple ways:
- You don’t need to install extra plugins.
- You don’t need to go through your WordPress theme to figure out where to put a code.
You don’t need to install extra plugins.
A big example of this is Google Analytics. You really don’t need to install and have all of your Google Analytics data showing in your WordPress admin area. Google Analytics already does a great job on their platform and it's free.
Most Google Analytics for WordPress plugins have paid versions that give you more access to displaying website traffic data in your WordPress admin area, but it’s not necessary. Again, Google Analytics is free.
You don’t need to go through your WordPress theme to figure out where to put a code.
If you really aren’t familiar with handling code, but at least can handle a little copy and paste, a header and footer WordPress plugin is super cut and dry. Some themes have a lot of different files for different purposes, so even if you paste any code directly within your theme’s header.php or footer.php file, you might end up with an error on the front-end of your website.
Header and Footer Plugins for WordPress: Top 6
- Ad Inserter
- Embed Code – Headers & Footers
- Head, Footer and Post Injections
- Header Footer Code Manager
- Insert Headers and Footers + Custom Code Snippets
- Woody code snippets
1. Ad Inserter
Ad Inserter is a plugin that is not just for ads, but where you can add code just about anywhere, whether it’s a tracking code, an image, ad network code, or more. In fact, you can add code to the following areas on your site:
- Before and after content on posts and pages
- Before or after a paragraph or multiple paragraphs
- Before or after an image
- Before or after comments
- Before or after displayed post excerpts
- Between blog posts on blog archive type pages
- Use a custom hook to display anywhere
Additionally the Ads Inserter plugin can be used to rotate banner ads or images, and has a lot of customization features.
2. Embed Code – Headers & Footers
Embed Code – Headers & Footers is super simple and allows you to add code to your header and footer. You can add codes like:
- Google Analytics website tracking code
- Website code verification snippets
- Typekit font script code
- Custom CSS
- Custom JavaScript
- Facebook Pixel tracking code
- Live chat integration code
3. Head, Footer and Post Injections
Head, Footer and Post Injections allows you to add code to almost anywhere on your site. With this plugin, here are some features you can enjoy:
- Add code before, after, and middle of posts and pages
- Add php code
- Add JavaScript to body tag
- Add shortcodes
- Turn on or off code injection for desktop or mobile
Please note that if you use Yoast SEO and have the Facebook Open Graph on, you may get a notice recommending you to remove the plugin. The developer says there’s no actual conflict, so you can ignore the notice.
4. Header Footer Code Manager
Header Footer Code Manager is a plugin that says it's dedicated to helping you add code to your site without breaking it. You can add as many code and scripts as you want. Here’s some of the Header Footer Code Manager’s features:
- Add code to header and footer
- Add code before and after both post and page content
- Display content on every post or page
- Conditional display for a specific post, page, custom post type, or taxonomy
- Shortcode support
- Option to display areas on desktop or mobile
This plugin works well with Google Analytics, Crazy Egg heatmaps, Hello Bar, Click web analytics, Facebook Pixel, and much more.
5. Insert Headers and Footers + Custom Code Snippets
Insert Headers and Footers + Custom Code Snippets has been around for some time and was formerly known as Headers and Footers. You can add code snippets just about anywhere, where it’s JavaScript, PHP, HTML, CSS, and more. Here’s a list of features for this plugin:
- Add code snippets to posts, pages, custom post types, and taxonomies
- Generator custom widgets, sidebars, navigation menus, and WP queries
- Option to display specific code snippets for logged in users or specific user roles
- Conditional options to display code snippets on specific posts, pages, custom post types, or taxonomies
- Add code to header and footer
- Option to load header or footer code depending on the referrer source
- Display code snippet for front-end of site
- Display code snippet in WordPress admin area
- Add code snippets before or after paragraphs
- Display codes between posts or post archive pages
- Import and export custom code snippets
This plugin includes support for Google Analytics, Facebook Pixel, and Rich Text ads.
6. Woody code snippets
Woody code snippets plugin allows you to create code snippets and re-use it using conditional logic, so you’re not recreating new snippets. Here’s a breakdown of what this plugin offers:
- Add code to header and footer
- Add PHP anywhere
- Show or hide code on a specific post, page, custom post type, or taxonomy
- Import or export code snippets
- Use shortcode
- Gutenberg content block editor and ClassicEditor friendly
In Summary
Now that you know about header and footer WordPress plugins, and how they can benefit you, then you might want to use one of the plugins mentioned in this article. It’s important to note that if you’re adding a lot of third-party scripts, to make sure they aren’t slowing down your website. If they are, you might want to seek an alternative method that is more optimized for speed.
Frequently Asked Questions
Is WordPress free?
All you need to do to use WordPress is to invest in a web hosting plan since the software itself is free.
Are WordPress plugins free?
WordPress has loads of plugins you can install, some of them are free, but some of them you will need to pay for. You can learn how to use WordPress Plugins on our blog.
What support will I receive for my plug-ins?
This depends on what you’ve purchased. Sometimes you may get support directly from your hosting provider, while with others you’ll need to contact the third-party platform directly.
How do I keep WordPress plug-ins up to date?
In most cases, your plug-ins will scan for updates automatically, but it’s always worth logging into your dashboard on a regular basis and performing a manual scan. This can usually be done in just a few clicks.
Nile Flores is a long time professional blogger, as well as WordPress website designer and developer from the St. Louis Metro East. Nile blogs at NileFlores.com, where she’s passionate about helping website owners, whether they’re small business owners or bloggers. She teaches about Blogging, Social Media, Search Engine Optimization, Website Design, and WordPress. Additionally, Nile loves to speak at WordCamps (WordPress conferences) across the United States. When Nile isn’t knee-deep in coding, she’s a proud mom of a college student, and enjoys oil painting, cigar smoking, nail art design, and practicing traditional Okinawan kempo karate.
View all posts by Nile Flores