GoDaddy has a vast domain registration and hosting. They can give us a free hosting if we register our domain on their server.  It is good to save money instead hosting separately with huge expense. But in a real world there is nothing free! GoDaddy also has no exception!

Problem

When we register our domain and setup our website contents including files onto their server and test our index page, we can see GoDaddy’s advertisement at the top of our webpage.

GoDaddy Adds

As an End User perspective this advertisement can create a pain and can impact on our website and its performance.

This ad situated in <IFRAME> tag at first child of <BODY> . And it’s javascript code (SRC = ‘https://a12.alphagodaddy.com/hosting_ads/gd01.js’) stayed at last child of <BODY>. By using ‘View Source’ or ‘Inspect Element’ we can see the ID of that IFRAME in this javascript. Please note that ID of IFRAME could be different for each domain.

Solution

Before going to solution we need think about our website, our users and the contents we have in our FTP account with GoDaddy. GoDaddy always checks whether the ads on each free hosting are active or not. So keeping in mind that we should avoid to hide or remove their javascript code. Else it could be possible that GoDaddy may cancel our account!

So instead worrying about their js we need to focus on the <IFRAME> showed on the top. By using CSS, Javascript, PHP or any server side language we can play with this IFRAME and get our work done.

The simplest way to do this is to use CSS!

#conash3D0 {
  height: 0px;
  top: -1px;
  margin: 0;
  padding: 0;
  font-size: 1px;
  z-index: -500;
  display: none;
  visibility: hidden;
}

Put this code into your external CSS stylesheet. If it does not work using external CSS then use it in a <HEAD> tag as internal stylesheet.

<head>
  <style ='type/css'>
    CSS code
  </style>
</head>

The other properties I have mentioned here with keeping in mind that GoDoddy can change their property values for their ads sooner or later.

Using jQuery to hide IFRAME:

$(function() {
   $('iframe').hide();
});

For this you will need ‘jquery.js’ – http://docs.jquery.com/Downloading_jQuery

Happy Free Hosting with GoDaddy!!! 🙂