Type to search.

#302 by installs

Head & Footer Code

by Aleksandar UroševićVersion 1.5.9

Easy add site-wide, category and article specific custom code before the closing </head> and </body>, or after opening <body> tag.

Active installs
100,000+
#302 of 1,000
Downloads, all time
2.8M
2,795,602
Downloads, 30 days
20.2K
4.5K in the last 7
Rating
5.0 / 5
51 reviews
Last updated
2 months ago
Aug 31, 2026
Version
1.5.9
36 releases

Upkeep and compatibility

Last updatedAugust 31, 2026Updated in the last 3 months
Tested up toWordPress 7.1.4Covers WordPress 7.1.4, the current release
Needs WordPress5.2 or newer
Needs PHP5.6 or newer
First publishedAugust 14, 2015
Support, last two months0 of 1 threads resolved (0%)

Reviews

5.0 / 5 from 51 reviews

Reviews by star rating
5 stars49
4 stars2
3 stars0
2 stars0
1 star0

Downloads, last 30 days

Low 398 a dayHigh 1.2K a day

What the author says it does

Head & Footer Code plugin helps you add custom code snippets (JavaScript, CSS, or HTML) to the page even if you are not a programmer. It could be within the <head> (site verification code for various services, custom styles, meta or Webfont link), right after opening <body> (pixel tracking, analytics or heatmap code) or just before closing </body> tag.

Go to Tools → Head & Footer Code in WordPress Dashboard. Insert custom code to HEAD, BODY or FOOTER section (depending on what you have to do).

All magic is done by hooking to WordPress hooks wp_head, wp_footer and wp_body_open.

💡 Trial Head & Footer Code plugin on a free dummy website before you add it on your project: Test It Now!

Various code snippets are supported, including but not limited to:

  • Google Analytics 4
  • Google Tag Manager
  • Google Ads Conversion
  • Lite Analytics
  • Facebook/Meta Pixel
  • Hotjar
  • FullStory
  • Google site verification
  • Bing site verification
  • Yandex site verification
  • Alexa site verification

Homepage in Blog Posts mode

If your WordPress shows the latest blog posts on the homepage, you can also add specific code only for the homepage on Tools → Head & Footer Code (there will be section Head, body and footer code on Homepage in Blog Posts mode)

Article specific code

The opening of the plugin's own description. The full text, installation notes and changelog are on its WordPress.org page.

Questions the author answers

On Network WordPress an Administrator/Editor/Author user getting code validation hint error `Tag is not allowed.`

It’s not a bug, it’s a security measure by WordPress Core.

If you wish to remove hinting errors for Administrator role, make sure you allow unfiltered_html capability for that role (Google is your friend).

Is supported PHP code in code snippets?

As it’s a security risk, the Head & Footer Code does not process PHP code if entered into any plugin field (global or article specific).

Any content added to HFC fields is printed on the front-end as is.

I entered code to BODY section, but nothing outputs on front-end

This feature is implemented since WordPress version 5.2 and requires theme compatibility.

To make sure if theme you use supports wp_body_open hook, open in code editor header.php file from theme you use, and check if right after opening <BODY> tag there is following code (if it does not exists, add it or ask some developer to do that for you):

if ( function_exists( 'wp_body_open' ) ) { wp_body_open(); }

Where do I report security bugs found in this plugin?

Please report security bugs found in the source code of the Head & Footer Code plugin through the Patchstack Vulnerability Disclosure Program. The Patchstack team will assist you with verification, CVE assignment, and notify the developers of this plugin.

Latest changelog entry

1.5.9 (2026-08-31)

  • Fix: JSON-LD and other article/category specific code saved before 1.5.8 could show backslash-escaped quotes; display is now corrected automatically without modifying stored post/term meta (thanks @sheenaljain for report)

Screenshots

First 4 of 8, from WordPress.org.

Tagged

Plugins that share its tags

#246 by installs

Header and Footer Scripts

by Anand Kumar

Header and Footer Scripts plugin allows you to add scripts to WordPress site's and just before closing tag.

Installs
200,000+
Rating
4.6 (58)
Updated
9 months ago

#32 by installs

Code Snippets

by Code Snippets Pro

Manage custom WordPress code in one dashboard. Create PHP and HTML snippets, preview code, track snippet totals and reuse code across sites.

Installs
1+ million
Rating
4.7 (510)
Updated
10 days ago

#105 by installs

Header Footer Code Manager

by DraftPress Team

Easily add tracking code snippets, conversion pixels, or other scripts required by third party services for analytics, marketing, or chat features.

Installs
600,000+
Rating
4.9 (309)
Updated
4 months ago

#204 by installs

Insert Headers And Footers

by Adnan

Include inline javascript, stylesheets, CSS code or anything you want in Header and Footer areas of your WordPress with ease.

Installs
200,000+
Rating
5.0 (135)
Updated
12 days ago

#211 by installs

Head, Footer and Post Injections

by Stefano Lissa

Head and Footer plugin lets you to add HTML code to the head and footer sections of your site pages, inside posts... and more!

Installs
200,000+
Rating
4.9 (735)
Updated
7 months ago

Where this page's numbers come from

Read from the WordPress.org plugin API on , when WordPress 7.1.4 was the current release. WordPress.org rounds active installs into buckets. These are the directory's figures, not my verdict, and I haven't tested this plugin. The author takes donations at their donate page.