WordPress.org

Ready to get started?Download WordPress

Plugin Directory

!This plugin hasn't been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

Ad Injection

Injects any adverts (e.g. AdSense) into the WordPress posts or widget area. Restrict who sees ads by post length/age/referrer or IP. Cache compatible.

Troubleshooting

Here are some things to check if the ads are not appearing, or are appearing when you think they shouldn't.

  1. Have you clicked the box to enable your ads?
  2. Would the options you have selected allow the ads to appear on that page?
  3. Have you cleared your cache (if you are using a caching plugin) to make sure that the page has the ads injected into it?
  4. If you still aren't sure why the ads aren't there (or why they are), click 'Enable debug mode'. Make sure the page gets regenerated (either by reloading, or by clearing the cache and reloading). The search the source code of the page (the HTML) for 'ADINJ DEBUG' tags. This will give you information about the decisions that the plugin made.
  5. Have you selected the correct insertion mode in the 'Ad insertion mode' section?
  6. The plugin inserts adverts after the closing HTML paragraph tag . If the ads aren't appearing where you expect, check where your tags are.

If ads aren't appearing on your archive (category, tag, author) pages

Ad Injection can only (with most themes) insert ads into archive pages if you are showing the full post. The ads will almost certainly get truncated or stripped out if you are showing excerpts.

I hope to add proper support for excerpt ads in a later release.

My adverts are overlapping with other page elements (e.g. images)

You can try defining the 'clear' display setting so that multiple floated parts of your page do not overlap.

If you always have a floated image at the top of the page you can set which paragraph the first random advert will start from. If you needed finer control over where the random adverts appear you can use the and tags in the page.

I have set the ads to float but the text/headings aren't flowing around them

Check your style sheet to see if either the text or headings have the 'clear' attribute set. This may be preventing your text / headings from flowing around the advert.

I have configured four Google AdSense ad units but only three are showing. Why?

Google's AdSense TOS only allow allow three ad units, and three link units per page. If you have for example tried to insert four ad units on your page then Google will (probably) disable the forth one automatically. Read Google's AdSense program policies for more info.

Parts of the adverts are appearing in the snippets on the archive and home pages

Ad Injection does not currently have support for inserting adverts into snippets, however ads in snippets may or may not work depending on how your theme processes the pages's content. If you end up with unwanted parts of the ad code in your snippets you may need to disable the top/random/bottom ads from your archive, home or front pages using the tick boxes near the top of the UI.

If you are using a caching plugin

  1. Have you enabled Ad Injection's 'mfunc' mode? (in the Ad insertion mode and dynamic ad display restrictions pane)
  2. If you use a version of WP Super Cache prior to 0.9.9.8 it must be configured in 'Legacy' mode for the dynamic features to work. If you use WP Super Cache 0.9.9.8 or above you can use any of the caching modes (mod_rewrite and PHP are faster than legacy).
  3. If you are using WP Minify as well then turn off the HTML minification as this strips out the mfunc tags that Ad Injection uses to check if the adverts should be inserted.

If you are using WP Minify

  1. Turn off the HTML minification mode if you are also using a caching plugin. HTML minification strips out the mfunc tags that Ad Injection needs to inject its ads.
  2. If you use the 'Place Minified JavaScript in footer' then try turning it off.

Only part of the setting screen is appearing

You are probably running out of memory. View the HTML source of the settings page (usually right click and View Source) and see if there is an out of memory message. You might have to delete/deactivate some other plugins, or search Google for advise specific to your web host.

If you are getting errors when using mfunc mode check the following

  1. Are there ad data directories in the plugin directory? The path will be:

'/wp-content/plugins/ad-injection-data/.

If not create this directory and make sure it is writeable by the plugin (chmod 0755 will do, chmod 0750 is better).

  1. Are there text files in the ads directories? The ad code that you enter into the ad boxes should get saved in text files in the ads directory.

  2. Has the config file been created? It should be at '/wp-content/ad-injection-config.php'. If not make sure the '/wp-content/' directory is writeable (chmod 0750 is best, chmod 0755 will do).

Errors after uninstalling the plugin

If you get an error like:

'Warning: include_once(/homepages/xx/dxxxx/htdocs/blog/wp-content/plugins/ad-injection/adshow.php) [function.include-once]: failed to open stream: No such file or directory in /homepages/xx/dxxxx/htdocs/blog/ on line xx'

Then you need to delete your cache. The references to the Ad Injection includes are still in your cached files, deleting the cache will get rid of them.

Reporting bugs

If you do get any errors please use the 'Report a bug or give feedback' link on the plugin to send me the error details. If things go so badly wrong that you can't even get to the settings page please send me an email via this contact form.

Requires: 2.8.6 or higher
Compatible up to: 3.4.2
Last Updated: 2012-8-11
Downloads: 269,089

Ratings

4 stars
4.4 out of 5 stars

Support

0 of 2 support threads in the last two months have been resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1
100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,2,2 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1
100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1
100,1,1 100,1,1 100,1,1 100,1,1 100,2,2 100,1,1 100,2,2 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1
100,1,1 100,1,1 100,2,2 100,1,1 100,1,1 100,1,1 100,1,1 100,2,2 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1
100,1,1 100,1,1 100,1,1 100,1,1
100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,2,2 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,4,4 100,2,2
100,1,1 100,1,1 100,2,2
100,1,1 100,1,1 100,1,1 100,2,2 75,4,3 100,2,2
100,1,1 100,1,1 100,2,2 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1
100,2,2 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1
100,1,1 67,3,2 100,2,2 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1
100,2,2 100,9,9 100,3,3 100,1,1 100,2,2 100,3,3 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,2,2 100,2,2 100,1,1 100,3,3 50,4,2 50,2,1 100,1,1
100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,2,2 75,4,3 100,1,1
78,9,7 100,2,2 100,1,1 100,2,2 100,1,1 100,3,3 100,1,1
100,3,3 100,1,1 100,4,4 100,1,1
100,1,1 100,4,4
100,4,4 100,4,4
100,6,6
100,7,7
100,8,8
100,3,3
50,2,1
100,1,1 0,1,0
0,1,0
0,1,0
67,3,2
100,1,1
100,1,1
100,2,2