Easily add tracking pixels, analytics, custom scripts, and CSS to your site. No coding skills required. Perfect for marketing teams and developers.
Head & Footer Code makes it simple to add any third-party code snippet to your WordPress site without touching theme files. Whether you need to install Google Analytics, Meta Pixel, site verification codes, custom CSS, or any other script, just paste it in and you’re done.
Features
Why choose Head & Footer Code?
- No theme editing required – Keep your theme files clean and safe
- Granular control – Add code site-wide, per category/tag, or per individual post/page, or even per custom post type and custom taxonomy
- Three strategic locations – Insert code in
<head>, after<body>, or before</body> - Marketing-friendly – Non-technical users can manage tracking codes independently
- Developer-friendly – Priority controls and debug mode for advanced customization
- Multisite compatible – Perfect for WordPress networks with role-based permissions
Integrate all your favorite tools
Analytics & tracking
- Google Analytics 4 (GA4)
- Google Tag Manager
- Lite Analytics and privacy-focused alternatives
- Custom event tracking scripts
Marketing & conversion
- Meta Pixel (Facebook Pixel)
- Google Ads conversion tracking
- LinkedIn Insight Tag
- Twitter/X Pixel
- TikTok Pixel
- Pinterest Tag
User experience & heatmaps
- Hotjar session recordings
- FullStory user analytics
- Crazy Egg heatmaps
- Mouseflow visitor tracking
Site verification & SEO
- Google Search Console verification
- Bing Webmaster Tools verification
- Yandex site verification
- Pinterest site claim
- Schema markup and structured data (JSON-LD)
Design & styling
- Custom CSS for site-wide design tweaks
- Google Fonts and Adobe Fonts (Typekit)
- Font Awesome and icon libraries
- Critical CSS for performance
Plus any custom code
- JavaScript libraries and frameworks
- Third-party widgets and embeds
- A/B testing scripts (Optimizely, VWO)
- Live chat code snippets
- Custom HTML anywhere on your site
Three levels of control
Site-wide code
Go to Tools → Head & Footer Code to add code that appears across your entire website.
Taxonomy-specific code
Add unique tracking or styling to specific categories (e.g., different pixels for product vs. blog categories).
Article-specific code
Use the metabox when editing any post, page, or custom post type to add unique code just for that page. Choose whether to append to or replace site-wide code.
Special features
Homepage control (Blog mode)
If your homepage displays the latest posts, you can add homepage-only code and control whether it appears on paginated pages (eg, page 2, 3, etc.).
Priority management
Fine-tune the order of the code execution by adjusting priority values (for developers who need precise control).
Role-based permissions
Allow Editors and Authors to manage article-specific code – great for marketing teams on multisite installations.
Debug mode
Enable WP_DEBUG to see HTML comments in page source showing exactly where each code snippet is inserted.
Technical Details & Architecture
Technical specifications
- PHP 8.5 compatible – Fully tested with latest PHP versions
- Multisite ready – Enterprise-grade permission controls
- Secure by design – Enhanced XSS protection and attribute filtering
- Clean uninstall – Removes all data from database on uninstall
- Minimal database impact – Efficient storage using WordPress options and meta APIs
The PluginTests provides automated smoke tests for Head & Footer Code.
How data is stored
- Global settings: Stored in WordPress options
auhfc_settings_sitewide,auhfc_settings_homepageandauhfc_settings_article - Other plugin keys:
auhfc_db_ver - Article-specific code: Stored in post meta
_auhfc - Taxonomy-specific code: Stored in taxonomy meta
_auhfc
All data is automatically removed during the uninstallation process. To preserve settings during reinstallation, deactivate (don’t uninstall), manually delete /wp-content/plugins/head-footer-code, then reinstall.
Permission levels (Multisite)
- Global settings: Super Admin and Administrator only
- Article-specific: Super Admin, Administrator (optionally Editor and Author)
- Category-specific: Super Admin and Administrator only
Download
You can download the plugin below or from the official WordPress.org page for Head & Footer Code while the development version can be found in the GitHub repository urosevic/head-footer-code
Head & Footer Code v1.5.5
55.7 KB
- Fix: Remove
set_time_limitfromupdate.phpto prevent fatal error on servers where it’s disabled
Installation
Getting started with Head & Footer Code takes less than 2 minutes. Choose your preferred installation method below.
Quick start (Recommended)
- In your WordPress Dashboard, go to Plugins → Add New
- Search for head footer code
- Click Install Now on the Head & Footer Code plugin
- Click Activate
- Go to Tools → Head & Footer Code to start adding your code
That’s it! You’re ready to add tracking codes, analytics, or custom scripts.
Alternative installation methods
Manual upload via WordPress Dashboard
- Download the plugin from WordPress.org
- In WordPress Dashboard, go to Plugins → Add New
- Click Upload Plugin at the top
- Click Choose File and select the
head-footer-code.zipfile - Click Install Now
- After installation completes, click Activate Plugin
- Navigate to Tools → Head & Footer Code to configure
FTP/SFTP installation
For users with direct server access:
- Download
head-footer-code.zipfrom WordPress.org - Extract the archive on your local computer
- Connect to your server via FTP/SFTP
- Upload the entire
head-footer-codefolder to/wp-content/plugins/ - In WordPress Dashboard, go to Plugins → Installed Plugins
- Find Head & Footer Code and click Activate
- Navigate to Tools → Head & Footer Code to configure
WP-CLI installation
For developers using command line:
wp plugin install head-footer-code --activateHow To Use?
Frequently Asked Questions
Can I use PHP code in the snippets?
No. For security reasons, Head & Footer Code does not execute PHP. All code is output exactly as entered – perfect for JavaScript, CSS, and HTML snippets.
I added code to the BODY section, but nothing appears
Your theme must support the wp_body_open hook (introduced in WordPress 5.2). If you are not sure, contact your theme developer for assistance.
Why do Editors/Authors see “Tag is not allowed” errors on multisite?
This is a WordPress security feature. Non-administrators are restricted from adding unfiltered HTML by default.
To allow Editors to add code on single sites, enable the option at the bottom of Tools → Head & Footer Code. For multisite networks, you’ll need to grant the unfiltered_html capability to the role (requires custom code or a capability manager plugin).
Where do I report security vulnerabilities?
Please report security issues through the Patchstack Vulnerability Disclosure Program. Do not post security issues in public forums.
Screenshots





What Users Say

References
YouTube Videos
- How to Add Booking Widget to WordPress Hotel Website with BNBForms by BNBForms (2025 February)
- DON’T install Google Analytics tag in WordPress manually – Instead do this by Your Man Nar (2021 October)
- Code in Head-Bereich von WordPress einfügen by eKiwi Webdesign (2020 October)
- Comment installer Google analytics avec TAG manager et le rendre conforme au RGPD by Dkoop, Internet Marketing (2018 June)
Dedicated Articles
- Preload Largest Contentful Paint image by WP Rocket (2025 February)
- Установка видео-виджета на WordPress by VidWidget (2025 January)
- 워드프레스 하위도메인에 애드센스 광고 나오게 설정하는 법 by IT테크 (2024 July)
- Add Chat Button to WordPress by Inkeep (2024 February)
- How to integrate WordPress with Metricalp by Metricalp (2023 November)
- How to install the Travelpayouts script on your website by Travel Payouts (2023 October)
- 워드프레스 head body 편집 수정방법 (feat. 플러그인, 테마편집기) by Jake (2023 October)
- 워드프레스 애드센스 승인코드 넣기 by 아몬드바나나 (2023 February)
- Mastodon-Account mit WordPress-Blog verifizieren – so funktioniert’s by Frank (2022 November)
- How to track UTM parameters & other lead source data in GetLeadForms by LeadCapture (2022 September)
- How to add BNBForms widget in WordPress by BNBForms (2022 May)
- Cómo añadir código en el head y footer en WordPress by Juanmi Carretero (2022 March)
- Bokningsassistent instruktioner by Bokahem (2022 January)
- SmartaPresentkort™ Installation av plugin by SmartaPresentkort™ (2021 November)
- معرفی افزونه Head & Footer و آموزش نحوه استفاده از آن by Zhaket (2021 July)
- Business Manager de Facebook: verificación de dominio by ZeroMoment Marketing (2021 May)
- Como cambiar el < head > de tu Wordpress by Seo y Social Media (2021 May)
- Как добавить код в head CMS WordPress – обзор отличных плагинов by Валентин @ WPTemplate (2020 March)
- How to Set Up Professional Analytics for Your Blog by Danielle Ramsey @ Building The Blog (2019 July)
- How To Disable Rich Pins and What Happened When We Did! by Chris @ Living The Blog (2018 June)
- How to Add Facebook Chat in a WordPress Website? by Azib Yaqoob (2018 May)
- Adding My Booking Widget to WordPress by Help @ Practice Better (2016 November)
- How to add sound to text in WordPress by Internet Marketing Light (2016 September)
- Get More Sales and Conversions With The Facebook Retargeting Pixel by Andrew Hubbard (2015 December)
- How-to Track Web Forms in WordPress by Mike Hakob @ Form Story (2024 May)
- The Best Way to Add Hotel Booking Form to WordPress by Ann Taylor @ BNBForms (2022 May)
- What are Core Web Vitals and how to measure them by Brian Fajar Mauladhika @ Hostinger (2022 March)
- Вставить код в раздел head на WordPress – темы, плагины и php функции by Валентин @ WPCourses (2020 June)
- Verify Your Website Domain for Google, Pinterest, etc by David @ ClickWP (2019 December)
- Anleitung: WordPress mit der Google Search Console verbinden by Christian Pust @ FastWP (2018 August)
Community
- Answer on Brizy by Kris Fitzgerald (2021 May)
- Answer on Reddit by zushiba (2020 October)
- Answer on Quora by Giovanni Pellegrini (2017 October)
Lists of plugins
- Schema markup: Deciphering the language of search engines by Austin Carroll on Search Engine Land (2025 June)
- Best Code Snippet Plugins for WordPress – 2025 by Tutsflow (2025 May)
- Best WordPress Plugin for Adding Code: Rocon’s Top Pick by ROCON (2025 April)
- 15 WordPress Code Editor Plugins to Edit Codes Easily by Shivanshi Srivastava on InstaWP (2025 March)
- 13 Best WordPress Plugins for Adding Code Snippets Without Breaking Your Site by Abdul Rehman on Cloudways (2024 August)
- 10 Best WordPress Plugins for Easy Code Integration by Shashank Dubey (2024 August)
- Best WordPress Plugin For Adding Code 2025 by Shashank Dubey (2024 July)
- Ajouter PHP à WordPress : 2 Méthodes pour Ajouter des Extraits de Code PHP by Chaimaa C on Hostinger (2024 March)
- 7 Useful WordPress Plugins That Help With Digital Marketing by Rhys Britton (2024 January)
- 7+ Best plugins to add different types of code snippets to WordPress blogs and websites by MH Themes (2023 November)
- 7 Best Code Snippets Plugins for WordPress: Customize Your Website However You Want by Marcus Cross (2023 March)
- 7 Best Code Snippets Plugins for WordPress by Corco Block (2023 March)
- 13 Insert Headers and Footers Plugins for Your WordPress Website by SKT Themes (2021 August)
- 12 Best Custom CSS WordPress Plugins to Add Styling by Dhiraj Das (2021 May)
- List Of Top Useful WordPress CSS Plugin In 2021 by Galusso Content Team (2021 February)
- 5+ Best WordPress Header Plugins 2021 by Mamta (2021 January)
- Top 6 Best WordPress CSS Plugins by Engine Templates (2019 December)
- List Of Best WordPress CSS Plugins by Age Themes (2019 December)
- Los 6 Mejores Plugins para Incluir JavaScript en WordPress by Pedro Mendez (2019 April)
- 10 Best Free WordPress Plugins by Omaha Code (2018 November)
- 7 Best plugins to add code snippets in WordPress blogs and websites by Lathiya Solutions (2018 October)
- The best and convenient plugins for WordPress by Łukasz Szmigiel (2017 November)
- Свой код в шапке или подвале. Как добавить? by Web5X (1970 January)
- How to Easily Add Header and Footer Code in WordPress by Robert Giaquinto on GreenGeeks (2019 June)
Need help?
If something isn’t working, please open a support ticket with details about your issue. We’re committed to helping you get it up and running.
Please check our FAQ section before opening a ticket to see if your question has already been answered.
If Head & Footer Code saves you time, we’d appreciate a review!