WordPress: How to display Adsense at the start/end of blog post content

If you’re new to Google Adsense, you may wish to start with this guide before following the guidance below.

Using theme hooks, it is possble to display Google Adsense ads in various locations on your site. In this guide, we will show you how to display ads at the start or end of blog post content.

How display Adsense ads at the start/end of post content

1. Go to your Google Adsense account and click on the “My Ads” button:

Google Adsense My Ads

2. Here you can access all of your ads. If you have not yet created one, click the “New ad unit” button:

Google Adsense New Ad Unit Button

3. Select “In-article ads” from the options:

Text display ads

4. We recommend that you leave all of the options as defaults for best results. Simply enter a name at the top and click the “Save and get code” button:

5. Copy the code provided:

6. Go to the “pipdig > Theme Hooks” section of your WordPress dashboard:

7. Paste the code into the “End of blog post content” or “Beginning of blog post content” box, depending on where you would like the ads to be displayed.

For example, here we have pasted the code into the “End of blog post content” box so that ads are displayed at the end of each blog post:

WordPress Google Adsense post footer

The ad should now be displayed in your chosen location. Please note, it may take 24 hours for ads to start working on your site. Before that time, the ads may appear as blank white spaces.

If you need any help setting up your Adsense account you can reach the Google Adsense team on their support forum.

Was this article helpful?


  1. Lucretia

    How do you put the ads into your articles, instead of just at the beginning and end?

    1. Phil (pipdig)

      Hi Lucretia, you could use this plugin to display ads within posts. This would give you control over where the ad appears within the content.

  2. Anna


    can you place these type of ads in specific posts only rather than every post?


    1. Phil (pipdig)

      Hi Anna, this feature is designed so you can easily display ads on all blog posts. If you wanted to display different ads in specific blog posts, the best solution would be to insert the ad into the post content using a plugin. However it is worth noting that Google Adsense will adapt to the page content automatically. For example, if a blog post was about flowers then the ad would probably be flower related. So you may not need to set different ad codes for each post.

Leave a comment

The link to your website will be visible to support staff only and will not be shown publicly.
If you do not yet have a website, you can use http://none.com.