Back to Community

Troubleshooting Common Ad Inserter Plugin Errors: A Practical Guide

39 threads Sep 16, 2025 PluginAd inserter – ad manager & adsense ads

Content

Many WordPress users rely on the Ad Inserter plugin for managing ads and custom code. However, like any complex plugin, it can sometimes throw confusing errors or behave unexpectedly. Based on community reports and troubleshooting threads, this guide covers the most common Ad Inserter issues and how to resolve them.

1. JavaScript Errors "Identifier has already been declared" or Settings Page Warnings

The Problem: Users report errors in the browser console like "Identifier ‘r’ has already been declared" or see a warning on the settings page stating "The page may not be loading correctly."

Why It Happens: These errors typically indicate a JavaScript conflict. This can occur when another plugin or theme loads a conflicting script, or when an ad blocker or caching plugin prevents Ad Inserter's necessary CSS/JS files from loading properly.

How to Fix It:

  1. Check your browser's developer console (F12) for any specific error messages or warnings.
  2. Temporarily disable other plugins one by one to identify a potential conflict.
  3. Switch to a default WordPress theme (like Twenty Twenty-One) to rule out a theme conflict.
  4. Clear all caching (both plugin and server-side caches) and disable any CSS/JS optimization features temporarily.
  5. Ensure you are not running any ad-blocking extensions in your browser while configuring the plugin.

2. Critical Errors "There has been a critical error on this website"

The Problem: Activating Ad Inserter causes a white screen or a critical error message on the front end or admin dashboard.

Why It Happens: A fatal PHP error is stopping code execution. This is often caused by a conflict with another plugin, an outdated PHP version on your server, or corrupted plugin files.

How to Fix It:

  1. Enable WordPress Debugging: Add define('WP_DEBUG', true); to your wp-config.php file to get a specific error message instead of a generic critical error. This message is crucial for finding a solution.
  2. Check PHP Compatibility: Ensure your server is running a PHP version supported by the plugin (typically PHP 7.4 or higher).
  3. Reinstall the Plugin: Delete the plugin and install a fresh copy from the WordPress repository. This replaces any potentially corrupted files.
  4. Check Error Logs: Your web hosting provider can often provide PHP error logs that contain detailed information about the crash.

3. Settings or Ads Disappearing

The Problem: Ad Inserter settings or inserted codes seem to reset or disappear.

Why It Happens: The plugin itself does not delete its settings. This behavior is almost always caused by an external factor, such as a database optimization cron job from your host, a conflict with a caching plugin, or a problem with the WordPress database.

How to Fix It:

  1. Contact your hosting provider and ask them to check for and repair any database issues.
  2. Ask if they run any automated database cleanup scripts that might be modifying the wp_options table where the settings are stored.
  3. Check for conflicts with caching plugins; try disabling them to see if the issue persists.

4. "Harmful Code" or Security Flag Warnings

The Problem: Security scanners or hosts flag code within Ad Inserter, such as eval() functions.

Why It Happens: Ad Inserter uses functions like eval() to execute custom PHP code that users input. This is a powerful and intended feature of the plugin, but security software can sometimes flag it as potentially dangerous.

How to Fix It:

  1. Understand that this is part of the plugin's core functionality for processing PHP code.
  2. If you are not using the PHP code feature, you can disable it entirely in the plugin's settings under Code editing to prevent these warnings.
  3. Always ensure you trust the source of any custom code you insert into the plugin.

5. Conflict with Other Plugins (Google API, Table of Contents)

The Problem: The plugin stops working or causes errors when another specific plugin is active (e.g., a fatal error about a "Google_Task_Composer" class or ads not showing with a Table of Contents plugin).

Why It Happens: This happens when two plugins try to load different versions of the same library (like Google API client) or when their output processing interferes with each other.

How to Fix It:

  1. Identify the conflicting plugin by deactivating others one by one.
  2. For fatal errors, you may need to temporarily disable the conflicting plugin to access Ad Inserter's settings.
  3. For display issues, try adjusting the "Processing priority" setting in Ad Inserter for the affected ad block.
  4. Check the documentation or support for the other plugin to see if they are aware of any conflicts.

General Troubleshooting Tips

  • Remote Debugging: Enabling remote debugging (as mentioned in many support threads) is one of the best ways to get help, as it allows others to see how the plugin is processing your pages. This is done via the plugin's settings.
  • Keep Updated: Always ensure you are using the latest version of Ad Inserter, as updates frequently contain bug fixes and compatibility patches.
  • Isolate the Issue: The standard troubleshooting process is to disable all other plugins and switch to a default theme. If the problem goes away, reactivate them one by one to find the culprit.

Most issues with Ad Inserter can be resolved through systematic troubleshooting. By following these steps, you can often identify and fix the root cause of the problem.

Related Support Threads Support