Uninvited StatCounter script in Wordpress
Summary: I found uninvited StatCounter HTML in my footer. Delete the theme’s functions.php file and remove the call to credits() in the theme’s footer.php, or redownload directly from the template’s creator (or some reputable website).
Problem: Playing around with BuiltWith, I discovered that my site was using StatCounter. Needless to say, I was surprised. The offending HTML, in the footer, was:
<script type="text/javascript" language="javascript">
var sc_counter=2600042;
var sc_invisible=0;
var sc_partition=24;
var sc_project=2511135;
var sc_security="30734c7d";
</script>
<script type="text/javascript" language="javascript" src="http://www.statcounter.com/counter/counter.js"></script><noscript><a href="http://www.studmed.com/"><img src="http://c25.statcounter.com/counter.php? counter=2600042&sc_project=2511135&java=0&security=30734c7d&invisible=0" alt="buy Viagra" border="0"></a></noscript>
Solution: The theme came with some, ahem, “extra” functionality. Delete functions.php and the call to credit() function in footer.php. Better yet, redownload the theme directly from its creator’s website.
Discussion: According to this, a website called Templates Browser has been redistributing third-party free Wordpress and Joomla themes with some extra code that puts the above StatCounter on your site.
I guess I downloaded my theme from a sketchy site. Colour me embarrassed.
August 15th, 2007 at 10:21 am 1
If it’s any help, GoStats is a great reliable web stats service.