30 days free. No credit card. Full access from the moment you connect your site.

Start free trial

Get Global Header and Footer Scripts

snippets/get-global-scripts reads the site-wide header, body and footer scripts WPCode outputs on every page.

These are not snippets. They are the original Insert Headers and Footers fields, stored in their own options.

At a glance

Abilitysnippets/get-global-scripts
ToolsetWPCode — toolset/wpcode
GroupWPCode › Global Scripts
RequiresWPCode, active on the site
Capabilitymanage_options
SafetyRead-only — changes nothing
RepeatableIdempotent — running it twice leaves the same result
Ships inAcrossAI Abilities Manager 0.0.34 and later

How it works

WPCode grew out of Insert Headers and Footers, and those three fields survived the transition unchanged. They have no code type, no conditional logic, no location and no active state — they simply output on every page of the site, always.

Which makes them easy to overlook. An audit of what runs on a site that only lists snippets misses three blocks of markup that run everywhere, including on checkout and login pages.

The body slot has a caveat the others do not: it is rendered through wp_body_open, and a theme that never calls that hook never outputs it. The response reports whether the active theme supports it, so a script that does nothing can be explained rather than debugged.

The option keys are returned too, which is what lets you find the same values through the options abilities if you need to.

Input

This ability takes no input.

What comes back

NameTypeWhat it is
headerstringThe markup output in the site head.
bodystringThe markup output just after the opening body tag.
footerstringThe markup output in the site footer.
body_supportedbooleanWhether the active theme calls wp_body_open. If not, the body slot never renders.
option_keysobjectThe option names these are stored under.
successbooleanWhether the call completed.
messagestringA one-line summary of what happened, suitable for showing a human.
error_codestringPresent only on failure — a stable machine-readable reason, such as a missing field, a wrong field type or an unmet confirmation.

Example

Ask your assistant:

What scripts are running on every page of this site?

It resolves to one call:

{
  "ability": "snippets/get-global-scripts",
  "parameters": {}
}

Worth knowing

  • These run on every page, unconditionally. No location, no rules, no active flag.
  • body_supported false means the body slot outputs nothing, whatever is in it.
  • Include these in any audit of what a site loads. A snippet listing does not cover them.

Related abilities


Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading