How to Insert Adsense Code Into a WordPress Blog Post

Ads that are strategically placed and keyword-targeted have a better chance of getting clicked than ads that are positioned where visitors do not notice them. When placing AdSense ads on your WordPress blog, the blog posts themselves are an obvious choice, as your readers spend much, if not most, of their attention on your posts. Try different types of AdSense ad units in various places in your posts, and remember to use AdSense channels to help track your ads' performance.

Instructions

    • 1

      Log in to Google AdSense and click "My ads" to go to your AdSense ads. Click "Get code" under the name of the ad you want to put in WordPress. When the pop-up box opens, click the text, right-click and click "Copy" to copy the code. Click "Close."

    • 2

      Log in to WordPress. Click "Appearance" and "Editor." When the theme editor loads, click "Single Post (single.php)" or similar name under "Templates" on the right of the page.

    • 3

      Look for a line similar or identical to the following piece of code in the PHP file. Note that the "the_content" line indicates where the blog post content is placed:

      <?php the_content('<p class="serif">Read the rest of this entry</p>'); ?>

    • 4

      Click above that line of code if you want the AdSense ad to appear above the post content. Click below that line of code instead if you want the AdSense ad to be shown below or after the post content.

    • 5

      Type HTML code to create formatting for the code before you insert it. For instance, type "<center>" without the quotes to make sure that the ad will be in the center when you place it.

    • 6

      Right-click and click "Paste," or hit "Control" and "V" simultaneously to paste the AdSense code. Close the HTML tag or tags you added. For example, type "</center>" to close the <center> tag.

    • 7

      Click "Update File."

    • 8

      Type the Web address of your WordPress blog in the browser location bar to visit the blog, or click its name on the top left of the WordPress admin page. Click any post to see how the AdSense ad looks on it. A blank space may appear at first, because it takes some time for ads to be generated according to the keywords in the post.

Tips & Warnings

  • Instead of placing the AdSense ad unit either above or below your WordPress posts, you can insert the ad to the top left of the first paragraph. Create a table with HTML code -- for example, <table align="left"><tr><td></td></tr></table> -- and insert the code between the <td> and </td> tags. Choose an ad that fits into the post, such as a small square or rectangular ad.

  • You could also use AdSense plugins for WordPress if you would rather not edit code.

Related Searches:

Resources

Comments

You May Also Like

Related Ads

Featured