25 May Getting Google Adsense Code to Work on Bridge Theme
Google Adsense has a reputation for being strict with their policies. While there is an incentive in placing ads on your site, the drawbacks can be harsh—pulling your ads down overnight—if Google notices that you violated their terms of service. Nevertheless, I feel Google Adsense is still the best ad agency online.I recently had some trouble figuring out how to apply for my Adsense account to get it reviewed. This required pasting the code Google provides into the “<head>” section of the website, or a the page where you want the ads to appear. After multiple attempts, I finally figured it out with this theme: Bridge (my favorite premium theme).
What Went Wrong
At first, I followed their instructions to the “tee”—only to have one of two things happen; either I was rejected for some reason, most likely because the code was somehow unreadable for Adsense reps to find, or the code would break my site—my pages would no longer appear.
Pages Not Appearing with Bridge Theme
Pasting the code below the “<head>” section in the “Header.php” tab (within Editor under Appearance in WordPress) would constantly cause the same problems. I tried various different spots, either below the first “<head>” or the second, and then attempted different placements with spaces in between to be extra sure. After doing this several times, the front page would load properly, but the Journal (blog page) would not. Thus I would have to remove the code from Editor and start over again.
Thus I went to many blogs and Google help strings—but nothing worked.
Until I Figured This Out
I simply used Visual Composer on the homepage of the site by placing Google’s HTML code into a ‘textbox’ I created. Then, when viewing the page the code did not show, which is proper. The next day I got an email from Google saying my Adsense account was approved for this site, and that I will start seeing ads appear in a few hours.
One More Glitch to Solve
After everything worked, I then could not get into my homepage from the other pages on my site (Journal, About, Contact, etc.), but I could access it from the address bar. So, I reached out to support on Bluehost, and they looked at the site—only to tell me the problem lied within the theme and was outside of their scope.
So there I was troubleshooting on my own again.
I had a feeling it was the initial code I placed on the homepage for the purpose of getting approved by Google to begin with, which wasn’t really a code that needed to be there…as I would discover. After researching a little on Google for the answer to this question (does the code need to stay on the site after approval) I found the answer within a support string of Google Adsense—well-meaning people just helping other people out.
The answer: no, the code does NOT have to stay there. So I deleted it from the homepage, and it solved the problem.