Contributors: HBJitney LLC
Tags: code, javascript, css, template
Requires at least: 6.1
Tested up to: 6.9.0
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html
Stable tag: trunk
Add custom Javascript/HTML/CSS codes to the page head without editing the template.
Intended users: Template Designers, Developer, Admins
If you wish to add any custom HTML to each page's header, then this plugin is for you.
This is useful for verifying you are the owner of the website to services such as Mailchimp or Google. You can quickly add the verification codes to your page header without having to edit your site's template.
In general, you can add custom CSS, a link to an external javascript file or something else. While it is generally recommended to create a child template if you're going to make extensive, permanent changes to a template, there may be instances where a small change or two is needed that wouldn't justify the creation of a child template—or your current template might not support child templates. You should nearly always avoid editing a template directly, because your changes will be lost when you next update the template.
This plugin is not affected by template changes.
- Click the big 'Install Plugin' button in the plugin description window
If you have a single file (ending in ".zip"), then use this method.
- From the plugins, add new, click on the upload button
- Navigate to where the .zip file is located and select it
- Make sure to activate the plugin once it is installed
If you have multiple files in a directory, use this method.
- Upload the entire directory (not just the files) to the
/wp-content/plugins/directory - Activate the plugin through the 'Plugins' menu in WordPress
The plugin now normalizes and sanitizes saved head code for users who do not have the unfiltered_html capability before it is stored, closing the stored XSS vector described in CVE-2025-48314 for untrusted roles. Site owners who intentionally grant unfiltered_html (such as administrators on single-site installs) still bypass this sanitization by design so they can insert arbitrary code.
Bottom line: the vulnerability of executing arbitrary code in the admin screens should be eliminated, however the functionality exists for public pages and is intentional. Only advanced users who know what they are doing should use this plugin.
Another plugin or the theme is adding their own codes to the head after this plugin runs.
You can, but you shouldn't. It is far too easy to break your site if you don't know what you are doing.
Q. Wordfence says something like "A potentially unsafe operation has been detected in your request to this site."
If you try to add a script or some other potentially-dangerous code (even if it isn't), Wordfence might complain. Double check your code and if it is okay, mark it as a false positive in Wordfence.
Disable the plugin. If your site is still messed up, then there's some other problem.
The problem lies in whatever you typed/pasted into this plugin's option screen. If you're really stuck, then try clearing out the code and starting over.
Similar to how widgets work, that data is stored in your database. If you made a backup before you deleted the data, then you can restore it that way, otherwise it is gone.
Right now you cannot. If there is sufficient demand, then we'll add it.
Absolutely!
Plugin Icon (CC BY 3.0) by DeniShop
- Fix for cross-site scripting vulnerability in admin pages (reported as CVE‑2025‑48314).
- Note: arbitrary code insertion on public pages remains intentional (and is the point of this plugin).
- Tested compatibility up to WP 6.7.1
- Added note about Wordfence error that might be encountered
- Tested compatibility up to WP 5.7.2
- Reformatted script: converted tabs to spaces
- Tested compatibility up to WP 4.6.1
- Name changed to (hopefully) reduce confusion.
- Screenshot updated
- Compatibility with latest Wordpress
- Readme file added
- Original release
- Fix for CVE ID: CVE‑2025‑48314
- Stored head code is sanitized for users without
unfiltered_html, mitigating the cross-site scripting (XSS) issue for untrusted roles
- Fixed bug that caused extra space to be added to head contents.
- Code quality and best-practice pass. No database schema changes; existing saved code is unaffected.
