Back to Community

Troubleshooting Common 'Head, Footer and Post Injections' Plugin Errors

19 threads Sep 16, 2025

Content

Users of the popular 'Head, Footer and Post Injections' plugin occasionally encounter errors that can range from simple notices to site-breaking white screens. Based on community reports and solutions, this guide covers the most frequent issues and how to resolve them.

1. White Screen of Death (Fatal Error: ob_start())

The Problem: After an update, your site displays a blank white screen. Your server error logs may contain a message like: PHP Fatal error: ob_start(): Cannot use output buffering in output buffering display handlers in .../header-footer/plugin.php on line 409.

The Cause: This is a known compatibility conflict that has occurred in past plugin versions, specifically related to the output buffering mechanism.

The Solution:

  1. Access your site via FTP or your web host's file manager.
  2. Navigate to the /wp-content/plugins/ directory.
  3. Rename the header-footer plugin folder to something like header-footer-DISABLED.
  4. This will deactivate the plugin and should restore access to your site. Check the official plugin page for an updated version that addresses this bug.

2. Undefined Index Notices (script_async_handles)

The Problem: Notices or warnings appear on your site's front-end or admin dashboard, such as: Notice: Undefined index: script_async_handles in .../plugin.php on line 66 or on line 131.

The Cause: These are not fatal errors but rather PHP notices indicating a variable is being checked before it's defined. They often appear after a WordPress core update.

The Solution: A common fix reported by users is simply to visit the plugin's settings page and click 'Save' again. This action can refresh the plugin's configuration and often makes these notices disappear.

3. PHP Code Not Executing (Displayed as Text)

The Problem: PHP code inserted into the header or footer is not executed and is instead output as plain text on your website.

The Cause & Solution: There are a few potential causes:

  • PHP Execution is Disabled: The plugin has an advanced setting to allow PHP execution. Navigate to the plugin's settings, go to the 'Advanced' tab, and ensure the option to allow PHP code execution is enabled.
  • Syntax Errors: A syntax error in your custom PHP code can prevent it from running. Double-check your code for errors, such as missing semicolons or brackets. Remember to use <?php and ?> tags.
  • Function Conflicts: If your code declares a function, ensure it is wrapped in a check to avoid redeclaration conflicts: if (!function_exists('my_function_name')) { function my_function_name() { ... } }.

4. Fatal Errors on Specific Pages or Actions

The Problem: A fatal error occurs when performing a specific action, such as uploading an avatar in BuddyPress or using the Site Editor.

The Cause: Often, this is not caused by the 'Head, Footer and Post Injections' plugin itself, but by a conflict with other code that is being injected by the plugin. JavaScript or PHP snippets added through the plugin can interfere with other scripts running on the page.

The Solution:

  1. Temporarily remove any custom code snippets you have added to the plugin's header, footer, or post sections.
  2. Check if the error persists. If it stops, the issue is with the injected code, not the plugin.
  3. Re-add your code snippets one by one, testing after each addition, to identify the conflicting code. You may need to revise the problematic snippet.

5. Cannot Access WordPress Admin (Locked Out)

The Problem: A severe error prevents you from accessing your WordPress admin dashboard to deactivate the plugin.

The Solution: The most reliable method is to manually deactivate the plugin using FTP or your hosting control panel's file manager, as described in the first solution above.

General Troubleshooting Steps

  • Clear Caches: Always clear any site, browser, or server caches after making changes.
  • Check for Updates: Ensure your WordPress core, theme, and all plugins are updated to their latest versions.
  • Conflict Test: As a general diagnostic step, temporarily switch to a default WordPress theme (like Twenty Twenty-Four) and disable all other plugins to see if the error persists. This helps identify if the issue is a conflict with your theme or another plugin.

If problems continue after trying these steps, it is recommended to search for or create a thread on the WordPress.org support forums for the 'Head, Footer and Post Injections' plugin, providing details of the error and the steps you have already taken.

Related Support Threads Support