Adding Adsense to Wordpress.

by taaron
10 replies
  • WEB DESIGN
  • |
Hi guys!

I'm trying to add Google Adsense to my personal blog. I was previously using a plug in, but this run I'm wanting rely less on plug-ins.

Would it be alright if I dropped my adsense code into the header.php and footer.php?
#adding #adsense #wordpress
  • Profile picture of the author David V
    I wouldn't do that..... a total loss of control over the display of the adsense.
    There's nothing wrong with plugins.
    The problems people have with plugins is they often use too many, and choose one's that are poorly coded.
    There's very little difference between having a feature (function) built into a theme or putting it into a plugin.
    Adsense is one of those things that should not be hardcoded in the theme.
    At some point you may change the theme, and you will lose anything you've done.
    {{ DiscussionBoard.errors[8012786].message }}
  • Profile picture of the author taaron
    Appreciate the input!

    I can't remember which Adsense plug in I used before my site was hacked, and the three I've tried so far haven't really thrilled me (though it was at a quick glance.)

    Any recommendations?

    Thanks!
    {{ DiscussionBoard.errors[8016740].message }}
  • Profile picture of the author Sire
    You can put adsense into a text widget in your sidebar. My theme actually has areas built into it for me to place adsense
    {{ DiscussionBoard.errors[8018620].message }}
    • Profile picture of the author mirza786
      Answer the following question:

      1) Your theme name
      2) Where you want to display your adsense add?
      3) If you can show your wbsite then it iwll be fine (otherwise it will be fine)..

      Thanks
      {{ DiscussionBoard.errors[8018652].message }}
  • Profile picture of the author RobinInTexas
    If you really want to do it, I'd strongly recommend using a child theme. But I prefer to use a plugin.

    My plugin of choice is WordPress › Ads by datafeedr.com « WordPress Plugins

    I also recommend

    WordPress › Google AdSense Plugin « WordPress Plugins
    Signature

    Robin



    ...Even if you're on the right track, you'll get run over if you just set there.
    {{ DiscussionBoard.errors[8018809].message }}
  • Profile picture of the author wrcato2
    Back in the old days of word press 1.2, you used to have to go into the code and place your publisher number into it. Today there are many varieties of great adsense themes that you could use.
    Many free...

    just type into your them search adsense themes

    or you can purchase a really pro theme from many different places.

    I like the heatmap theme and that is the theme I use on all of my adsense sites.

    Inside of this theme has a built in area to place up to 25 different ad code.

    Check out these screen shots:
    [IMG][/IMG]

    and


    [IMG][/IMG]
    {{ DiscussionBoard.errors[8019167].message }}
  • Profile picture of the author Brandon Martin
    Originally Posted by taaron View Post

    Hi guys!

    I'm trying to add Google Adsense to my personal blog. I was previously using a plug in, but this run I'm wanting rely less on plug-ins.

    Would it be alright if I dropped my adsense code into the header.php and footer.php?
    I think it is wise to be cautious about Adsense plugins. A couple of years ago a number of top Adsense plugins, including a couple in the Wordpress.org repository, stole impressions from the users who installed them. Basically 4 out of 5 times, the plugin would display the adsense block with the user's correct UA identification string, but on the fifth time, the plugin would insert the plugin author's UA identification string instead of the user's, so that the plugin author would get credit for any click resulting from that impression. The ratio of 1 out of 5 stolen impressions or so, seemed to work wonders as users didn't seem to figure it out based on their analytics or results and the plugin authors were able to obtain installation on tens of thousands of blogs.

    My preferred method is to create a shortcode within functions.php that inserts the adsense block where I want it within an article with css-based formatting. So, if I want a medium sized block floated left my shortcode might be [ads-med-left]. I simply type that wherever I want the adsense to go. Sure, it's not automated, but if you wanted, you could tie the shortcode to a custom button on your editor and then click-to-insert. There are plugins for that. Heck, there are plugins to create shortcodes, so you don't have to mess around with your functions.php file.

    Good luck!
    {{ DiscussionBoard.errors[8023207].message }}
  • Profile picture of the author taaron
    Wow. I had no idea they'd do that. That's kinda lame, if they're not up front about it.

    Anyhow, I've been playing with Adsense plug-ins to find one I like... but one of them I didn't like has messed up my site, dropping seemingly permanent and useless ad-blocks onto the page that can't be removed or edited.



    I have deactivated all of my installed plug-ins and yet those useless blocks still remain. How do I fix this?

    Edit: Fixed it by reinstalling WordPress.
    {{ DiscussionBoard.errors[8043385].message }}
  • Profile picture of the author vrtechnologies
    I am suggest this one WordPress › Wp-Insert « WordPress Plugins
    Or Need to use the widget..
    {{ DiscussionBoard.errors[8044285].message }}
  • Profile picture of the author taaron
    Yikes. Sorry. I forgot to update everyone.

    Got it all figured out, after uninstalling and re-installing the site.

    I had installed an ad plugin and forgot all about it. As such it was never set up, and placed those grey boxes. A few more "Doh!" moments later and the site was ready to show ads!
    {{ DiscussionBoard.errors[8114592].message }}

Trending Topics