Ads Detected While Submitting Theme to WordPress Themes Directory

Posted in Wordpress Development on 1 September 2009 11 comments

We’ve detected ads as part of your theme. They need to be removed before your theme will be allowed into the theme directory.

I got this message above when I submit my Lunated theme to WordPress Themes Directory. But the problem is, I do not have any advertisement or sponsored links in that theme.

I can’t seems to find the solution after some time. Therefore, I created a support thread and end up emailed the theme to wordpress team and told them the problem.

It’s Him. Hardcoded Google Adsense Codes

Finally, I got a reply from the team few hours later:

The upload process is picking up the hard coded adsense items in your theme (in header.php for instance). Generally when themes want to support showing ads like this they just provide a way to paste in the ad code.

So, in case you got the error message while you submit a theme, you know what to look for.

What did I mean by Hardcoded Google Adsense Codes?

It is actually the whole part of javascript provided by google adsense after you’ve created a new ads.

<script type="text/javascript">
google_ad_client = "pub-<?php echo $zenverse_global_adsense_id; ?>";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text";
google_ad_channel = "";
google_color_border = "82cf1e";
google_color_bg = "82cf1e";
google_color_link = "555555";
google_color_text = "555555";
google_color_url = "555555";
google_ui_features = "rc:0";
<script type="text/javascript" src=""></script>
Now that I had this problem, what should I do?

All I wanted is to let save my theme users’ time, allow them to display google ads in a simple way – by just entering adsense publisher id.

Now that I had this problem, I can do nothing but to remove all adsense codes from the template files and provide a way to paste in the ad code in theme option page.

Last but not least, I’ve created a page for user to get adsense codes for their theme along with recommended background and text colours. Look, I want to save their time again :)

Things you also need to check

Beside google adsense, if you have advertisement slots (eg: 125×125 ads at sidebar) in your theme, you might get that message too. You don’t have to remove the slots, just disable them by default.


Posted by Zen on 1 September 2009 • 12,858 visits 11 comments
Tags :

or Subscribe to specific category only :


Btrflyed says:

Check your footer. The links there are not links to your site or your theme. I like the theme personally, but will not be using it because of these links.

zen says:

@Btrflyed, for your information, I have themes with no sponsored links too.


Andrew says:

I bet that was a typo. They surely meant don’t show it by default.

zen says:

@Andrew, Andrew you’re right I just received en email from them that says “OOPS it was a typo” :)

I updated the post.

Cheers :)

jose says:

Awesome themes all around, I’m thinking about switching over to one. One question though. I’d like to be able to put html linked text on top of the feature photo. Would that be difficult?
.-= jose´s last blog ..Live Music Thursday at Springers Creek Winery =-.

zen says:

@jose, which theme did you mean? Thank you.

jose says:

@jose, Stripe Square.

zen says:

@jose, but that theme is not available for download yet.

Anyway, it won’t be difficult.

jose says:

@jose, What about for the “Delight” theme?

zen says:

@jose, same, just need a tweak.

Arthur says:

I tried searching for your other themes (other than Lunated) and couldn’t find anything; I’m wondering if that’s why – thankfully I found your site.

I wish they were smarter about seeing what you were trying to do; but in any event, thank you for creating the AdSense code generator page – it really helps and is a major step-out that other theme creators don’t provide.

Leave a Reply

You must be logged in to post a comment.

Previous Post
Next Post