Title: Replace Site-Wide Code function not working
Last modified: October 13, 2021

---

# Replace Site-Wide Code function not working

 *  Resolved [aglyons](https://wordpress.org/support/users/aglyons/)
 * (@aglyons)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/replace-site-wide-code-function-not-working/)
 * I have some scripts added to the config for all pages in the header and footer
   code areas.
 * For some landing pages, I want to exclude some scripts so I added the standard
   tracking scripts to the landing page header code and selected the replace the
   site-wide code option.
 * It’s not totally clear but does that option only apply to the header code section?
   I have some scripts in the site-wide footer code section and those scripts are
   still being loaded when they shouldn’t be. On the linked page the Frase chatbot
   should not be loading. That script that loads that is in the site-wide footer
   code section. This landing page’s footer code section is blank.
 * Yes, I have cleared all server and client-side cache.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Freplace-site-wide-code-function-not-working%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [aglyons](https://wordpress.org/support/users/aglyons/)
 * (@aglyons)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/replace-site-wide-code-function-not-working/#post-14970270)
 * So I have discovered that even though that switch is in place, the other sections’
   code blocks will retain the global settings unless you add something in those
   blocks. Leaving them blank does not mean that the per-page setting will remove
   the global code.
 * I had to add <script></script> in order to disable the global content and replace
   it with the per-page content.
 * Is this by design?
 *  Plugin Contributor [TechWebUX](https://wordpress.org/support/users/techwebux/)
 * (@techwebux)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/replace-site-wide-code-function-not-working/#post-14973928)
 * Hello [@aglyons](https://wordpress.org/support/users/aglyons/),
 * Thank you for choosing Head & Footer Code for your project, and please excuse
   me for late response.
 * Yes, you are right – the ‘replace’ behavior for the articles specific code work
   as you mentioned.
 * Just instead of empty script, you can use empty space character (which will be
   trimmed so no additional code will be added to HTML code anyway, or use empty
   HTML comment `<!-- -->` if you prefer to see where article specific code is inserted.
 * Please let me know if you have any other questions?
 * Kind regards,
    Aleksandar

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Replace Site-Wide Code function not working’ is closed to new replies.

 * ![](https://ps.w.org/head-footer-code/assets/icon.svg?rev=3299702)
 * [Head & Footer Code](https://wordpress.org/plugins/head-footer-code/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/head-footer-code/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/head-footer-code/)
 * [Active Topics](https://wordpress.org/support/plugin/head-footer-code/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/head-footer-code/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/head-footer-code/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [TechWebUX](https://wordpress.org/support/users/techwebux/)
 * Last activity: [4 years, 7 months ago](https://wordpress.org/support/topic/replace-site-wide-code-function-not-working/#post-14973928)
 * Status: resolved