Beginner bloggers and online marketers often make the mistake of placing ads in headers and sidebars. Although these locations can yield some decent results, advertising platforms typically recommend learning how to add inline content ads to WordPress. An inline advertisement is shown in your post or page content, so maybe right below the first or second paragraph or scattered throughout a blog post to improve conversions.
Inline ads can be seen as somewhat distracting to users, so that’s why it’s important to use them sparingly, and somewhere toward the top and bottom of your post or page, to ensure that you’re getting enough clicks.
How do you add inline content ads to WordPress?
This sounds like a complicated task, since going to Google AdSense and copying the code manually into every individual post is going to take forever. You might be able to get away with this for a newer, smaller blog, but eventually, you need a way to place an ad inside every post (in a specific location) without having to copy and paste the code manually.
Luckily, several plugins allow for this functionality, most of which cut out the majority of coding that you would have to complete otherwise. There’s still a bit of code copying, from places like AdSense, but it’s not more than a five minute task. For this tutorial on how to add inline content ads to WordPress, we’re going to make the demonstration using the Google AdSense network. This is mainly because it’s one of the most popular ways to get dynamic ads on your site, and it’s known for delivering relevant ads.
1. Create an AdSense Account (Or Any Other Add Network Account)
Go to the AdSense website and either create an account or login with one of your previously created Google accounts. We’re not going to walk through the entire Google AdSense process right here, but we do have a great article for configuring AdSense properly for your blog. That said, the process mainly entails getting your account activated and verified, while also generating individual ad units or going to the Auto Ads section for the most effective method.
Once you create your automatic advertisements, it provides the code needed for dynamic ads based on what your users have searched for in the past.
2. Install and Activate the Ad Inserter WordPress Plugin
Quite a few plugins are available to add inline content ads to WordPress, but one of the most feature filled and easy to use is called Ad Inserter. Therefore, install the Ad Inserter plugin, then go ahead and activate it. Most of the default settings are fine right out of the box, but you will have to go in and specify how and where you would like the ads to show up.
3. Set an Advertisement to Show Up Below the First Paragraph on Every Blog Post
To find the Ad Inserter plugin settings, go to the WordPress dashboard menu and click on Settings > Ad Inserter.
This module looks a little confusing at first, but it’s actually quite simple once you get the hang of it. Not only that, but you’ll learn that it’s by far the best plugin in terms of flexibility or your ad placements.
The numbers at the top of the module represent different blocks you can create to add inline content ads to WordPress. So, if I had one ad showing up after the first paragraph of a post, and another ad showing up right before the last paragraph, those would be two separate ad blocks. For this example, we’ll only make one.
Take the Auto Ad code or the Ad Unit code from your Google AdSense page and copy it to your clipboard. This would usually be the code that you manually paste into the body of your page, but with the Ad Inserter plugin, you only need to do it once – in Ad Block 1, or whichever you would like to use.
By default, the Automatic Insertion area is set to disabled, but you want to adjust that to place the advertisement after a certain paragraph, between comments, or wherever you find it suitable. For this tutorial, we’re selecting the After Paragraph option.
Once you select the After Paragraph field, you have the option to type in how many paragraphs. So, if I’d like this particular advertisement to appear after the first paragraph, I’d type in the number 1.
If you’d like to individually enable or disable ads on every post, you have that feature in the dropdown below. However, we figure most people will want the ads to automatically appear on every single post. In that case, select the blank option to remove any post exceptions.
You can get really specific with the placement when you add inline content ads to WordPress with this plugin. There are tools for the alignment, style, and post exceptions. Feel free to play around with this to meet your own needs. But for right now, this is the simplest way to place an inline ad in your WordPress post.
Here are my final settings for revealing a Google AdSense advertisement below every first paragraph in my WordPress posts:
Make sure you click on the Save All Settings button before moving away from the page.
4. Copy AdSense Code Into the Head Area of Your Website
There’s also a piece of AdSense code that has to be placed in the <Head> area of your website. This area is found in the header.php file. Search for the <head> tag and place the required code in right below that, even if you already have some other bits of code below the tag. This pushes everything else down, and shouldn’t affect the functionality of your site.
5. Test the Code on the Frontend of Your Website
I would assume you already have some blog posts published on your website, but if not, go ahead and make a test post. Then the only thing you have to do is ensure that there are enough paragraphs in the article for the advertisement to be displayed. For this tutorial, all I need is two paragraphs, since the plugin recognizes that first click of the Enter key as the end of the first paragraph.
As you can see, the backend of your post won’t display any of the ads we implemented. However, you can then click on the Preview or Publish button to see how they show up on the frontend. The frontend display needs a little formatting to make them more visible and appealing, but that can all be done through the Ad Inserter Settings page.
In addition, there’s a module in every post that gives you some manual power over inline ads. So, if you added some exceptions to the Ad Inserter plugin you might have a checkbox to remove or include an ad in this particular post.
Are You Ready to Add Inline Content Ads to WordPress?
The goal with your inline content ads is to make the advertisements look as natural as possible. This way, people are more likely to click on them and not be annoyed by the disruption.
If you have any questions about how to add inline content ads to WordPress, let us know in the comments section below.