WP Manifestindependent plugin directory
manifest / analytics / adsense-inject

Simple Google AdSense inject

A simple Wordpress plugin to add Google AdSense everywhere except on specific posts as configured from the WordPress admin panel.

★ 1stars
v1.12latest · 16d ago

Install

Download adsense-inject-1.12.zip From the v1.12 release on GitHub, Oct 18, 2026

Upload it under Plugins → Add New Plugin → Upload Plugin, then activate.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/vdite/adsense-inject/releases/download/v1.12/adsense-inject-1.12.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

A lightweight WordPress plugin that loads the Google AdSense script on every public page of your site — except on a configurable list of excluded post IDs.

Features

  • Loads the AdSense loader script (adsbygoogle.js) site-wide.
  • Exclude individual posts, pages, or custom post types by ID.
  • Skips feeds and preview requests.
  • Async loading via the modern strategy arg (WP 6.3+) with a filter-based fallback for older versions.
  • Input sanitization for both the Client ID and the excluded-ID list.
  • Cleans up its options on uninstall.

Requirements

  • WordPress 5.8 or higher
  • PHP 7.4 or higher
  • A valid Google AdSense publisher ID (format ca-pub-xxxxxxxxxxxxxxxx)

Installation

  1. Copy the plugin folder into wp-content/plugins/ (or upload the ZIP via Plugins → Add New → Upload Plugin).
  2. Activate Simple Google AdSense Inject in the WordPress admin.
  3. Go to Settings → AdSense Excluded Posts.
  4. Enter your AdSense Client ID (e.g. ca-pub-1234567890123456).
  5. Optionally enter a comma-separated list of post IDs where AdSense should not be loaded (e.g. 7658,971590).
  6. Save.

How it works

On every front-end request (except feeds and previews), the plugin enqueues:

https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-...

If the current request is a singular view (is_singular()) and the post ID appears in the excluded list, the script is not enqueued for that request.

Uninstall

Deleting the plugin via the WordPress admin removes both stored options (adsense_post_ids, adsense_client_id) via uninstall.php.

License

GPL-2.0-or-later — see LICENSE.

Author

Viktor Dite — mizine.de

Releases

1 release. Each count is every asset in that release; expand a row for the breakdown.

Tag
Published
Assets
Downloads
v1.12 latest
Oct 18, 2026 16d ago
adsense-inject-1.12.zip
0