Recently Google made their changes to the fold algorithm which dictated that we should no longer have more than two ads above the fold on our website, and that the adverts we do have should be surrounded by lots of content. This then resulted in a huge clamour of activity as webmasters ran around and removed adverts from their pages or moved them further down the page.
I was one such webmaster, and at one point I had adverts at the top of several of my pages before ANY content which meant basically that I was in trouble.
The problem was that the site in question had hundreds of pages and articles and my Google AdSense was in the top spot of every single page. This then meant I had a mammoth of a task ahead of me to find and replace all of them, which meant I in turn had to spend ages looking around my site for instances of this mistake and replacing it manually for hours. Or did it…?
The Alternatives
The good news is that thanks to a little bit of software called Dreamweaver I actually didn’t have to do anything of the sort. Using Dreamweaver I was able to simply search and replace lines of code across entire folders and this way I could search for the AdSense and alter it.
Of course though this still requires thought and consideration even once you’ve got the find ad replace utility as you have to think of a way that you can alter every single instance of the code, and of course I also wanted to insert copies of the code every page too, just further down.
Ultimately my solution was to move the AdSense to the right with the align tag rather than to delete it so that it shared the space with more content but so that I still had some advertisement on my page.
My other option was to turn the AdSense into annotation and then to look for something that occurred on all or most of the pages and to insert the code again there. In short though if you think outside the box and look long and hard at your code, then you can often avoid having to make replacements by hand.
Thinking Ahead
But far better would have been for me to have realised the potential that I would want to make changes *before* I designed the site and to have made it easy for myself.
The very easiest way to do this is by including code in an include file or in a CSS script. This way you can include elements on every page but only have to edit one location to change them which makes life much easier.
My friend meanwhile has another system which is to include two copies of all his website files on his computer, and in one of the versions he has things like AdSense and other elements he might want to change such as the font or the color missing, and instead he includes a little symbol such as %%%. This then means that in order to make a new copy of the website with new ad code or with new font he can simply search and replace the %%% in order to do so.
This post was written by guest blogger Patrick. He runs YarraWeb a web design Melbourne company and likes to write about emerging web trends.