Skip to content
Plugin PantryPlugins

Plugins / Pantry Code

Three boxes: head, after the opening body tag, and footer. Paste analytics, verification tags or a snippet and it prints exactly where you put it. Each post and page can add its own. Only users allowed to publish unfiltered HTML can edit them.

Compared with the popular plugins

The Pantry Code settings screen in the WordPress admin, at Plugin Pantry > Code.

What it does

  • Site-wide head, body-open and footer snippets, printed on wp_head, wp_body_open and wp_footer
  • Per-post snippets for the same three positions from a meta box on every public post type
  • Editing requires the unfiltered_html capability; the screen is read-only without it and when DISALLOW_UNFILTERED_HTML is set
  • Option to skip logged-in users, useful for analytics
  • Never prints on admin, login or REST responses
  • Plain warning on the screen that the snippets run as written

What it does not do

  • No PHP execution
  • No conditional rules
  • No snippet library
  • No tag manager helpers

Measured footprint

Zip size
19 KB
Lines of PHP
1,277
Options
pantry_code_settings
Post meta
pantry_code_head, pantry_code_body, pantry_code_footer
Custom tables
none
Post types
none
Cron events
none
Transients
none
Admin assets
includes/core/assets/pantry-admin.css and pantry-admin.js, enqueued only on the Settings > Pantry Code screen
Front-end assets
none
External requests
none
Measured on
2026-09-12

Compatibility

WordPress
6.4 or newer, tested to 7.1
PHP
8.1 or newer
Where it lives
Plugin Pantry > Code
Licence
GPLv2 or later

Every setting on the Pantry Code screen and what each one does, with the hooks it publishes: the same text that ships in the plugin README.

Pro add-on (planned)

See Pantry Pro pricing
  • Conditional rules by post type, URL, role and device
  • Google Tag Manager and GA4 helpers
  • Snippet library with enable switches

Planned for a later Pantry Pro release. Nothing in the free plugin waits on it, and a licence bought today covers it the day it ships, since one key covers every module.

Changelog

All notable changes to Pantry Code are documented here. Format follows Keep a Changelog.

1.0.0 - 2026-09-12

  • Site-wide head, body-open and footer snippets, printed on wp_head, wp_body_open and wp_footer.
  • Per-post snippets for the same three positions from a meta box on every public post type.
  • Editing requires the unfiltered_html capability; the screen is read-only without it and when DISALLOW_UNFILTERED_HTML is set.
  • Option to skip logged-in users.
  • Never prints on admin, login or REST responses.
  • Plain warning on the settings screen that snippets run as written.