Revenue SharingRevenue sharing could be implemented in a multi-author blog to pay guest authors for their efforts. Sometime back I implemented this on MightyLaws, my another blog which I founded 4 months ago and have been administering it since then. Its a LAW related blog, Which aims at Simplyfing the “Mighty Laws”.

Coming back to the point How to Manually Implement Google Adsense Revenue Sharing in your blog.

What differentiates each Adsense unit is “google_ad_client” and “google_ad_slot” values apart from the ad unit size. So we’ll add two new text fields to WordPress User Profiles, client and slot for each author to put his Adsense ad_client and ad_slot value in his/her user profile.

We’ll then code the Adsense unit to take ad_client and ad_slot values from the particular post author’s profile on whichever post it loads on. So the Adsense code will automatically change with the post author.

Procedure to add Revenue Sharing functionality to a Multi-Author WordPress Blog

1.) Firstly we’ll Add two new text fields to user profiles, client and slot.

Add the following code to the functions.php file in your theme folder, head-over to WordPress Dashboard>Appearance>Editor>functions.php or do it via ftp.

function add_adsense_contactmethod( $contactmethods ) {
$contactmethods['client'] = 'client';
$contactmethods['slot'] = 'slot';
return $contactmethods;

Two new fields have been added to the user profiles


Users can now enter their own “google_ad_client” and “google_ad_slot” values in their profile.

Note: Enter the default ad_client and ad_slot values in the client and slot field, in case a user does not have Adsense verified account default ad unit will be displayed. Otherwise no ad unit will be displayed on the user’s post(s).

2.) Now we’ll edit the Adsense unit code to take google_ad_client and google_ad_slot values automatically from the author’s profile.

Replace the google_ad_client value with

<?php the_author_meta('client'); ?>

and google_ad_slot value with

<?php the_author_meta('slot'); ?>

It should look like:

<script type="text/javascript"><!--
google_ad_client = "<?php the_author_meta('client'); ?>";
/* 468x60 */
google_ad_slot = "<?php the_author_meta('slot'); ?>";
google_ad_width = 468;
google_ad_height = 60;
<script type="text/javascript"

This ends the procedure. Each post in your blog will now display Adsense unit of the particular author it belongs to.

You have successfully implemented Adsense Revenue sharing in your WordPress blog. Feel free to comment-in your query or doubts, I’ll be happy to answer them.

Also see: Implement Google Adsense Section Targeting in your WordPress blog