In content marketing and website monetization, Google AdSense’s in-line ads are a very effective way to monetize. By inserting ads naturally in the content of the article, CTR and earnings can be significantly increased. This article will detail how to configure Google AdSense’s inline ads in WordPress using the WPCode plugin to achieve the best results.
Why choose an article embedded ad?
Inline ads are an ad format provided by Google AdSense that integrates seamlessly with website content for a better user experience and higher advertising performance. According to Google’s recommendations, the inline ad should be placed in the content of the article, not the sidebar or footer.

Create an embedded ad unit for Google AdSense articles
First, create a new ad unit in your Google AdSense account:
- Sign in to your Google AdSense account
- Click ‘Ads’ > ‘By Ad Units’
- Select ‘Article Inline Ads’ type
- Configure ad styles and dimensions
- Name the ad unit, such as ‘A single article middle ad’

Get ad code
After creating an ad unit, Google will provide a piece of HTML code, which is the ad code we need to insert into WordPress:
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8392190980622725"
crossorigin="anonymous"></script>
<ins class="adsbygoogle"
style="display:block; text-align:center;"
data-ad-layout="in-article"
data-ad-format="fluid"
data-ad-client="ca-pub-8392190980622725"
data-ad-slot="8627057919"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
Manage ad inserts with WPCode plugin
WPCode is a powerful WordPress code snippet management plugin that can easily insert code at different locations of the website. Here are the configuration steps:
1. Install and activate the WPCode plugin
In the WordPress background, navigate to ‘Plugins’ > ‘Add new plugins’, search and install the WPCode plugin.
2. Add ad code snippet
Add a new code snippet in wpcode:
- Click ‘Add Code Snippet’
- Select the ‘HTML fragment’ type
- Paste the code obtained from Google AdSense
- Configure the insertion position as ‘insert after paragraph’
- Set the paragraph number to 4 (represented after paragraph 4)

3. Create multiple ad units
In order to maximize the profit, it is recommended to create multiple advertising units and insert them in different paragraphs:
- Ad unit 1: Insert after paragraph 4
- Ad unit 2: Insert after paragraph 10
- Ad unit 3: Insert after paragraph 20
In WPCode, these ad units appear as different code snippets:


Actual effect display
After the configuration is complete, the ad will automatically display in different positions according to the length of the article:
- Short articles (less than 4 paragraphs): No embedded ads are displayed
- Medium length articles (paragraphs 4-9): Only ads after paragraph 4 are displayed
- Long articles (pars 10-19): Displays ads after paragraphs 4 and 10
- Long article (20 or more): Show all three ads

optimization suggestion
- Test different locations: Determine which ad works best by analyzing AdSense data
- Maintain content quality: Don’t over-insert ads, so as not to affect the user experience
- responsive design: Make sure ads are well displayed on different devices
- Periodic inspection: Regularly check ad display performance and revenue data
Through the above steps, you can effectively configure Google AdSense’s article embedded ads in the WordPress website to maximize the profit and maintain a good user experience.
Technical Blog Growth & Monetization Consulting
I have been running my personal technology blog for more than 10 years and have published over 1,000 original articles covering WordPress optimization, multilingual websites, Google SEO, content strategy, and website monetization. All insights shared on this site come from real-world operation and long-term experimentation. If you are building a blog, developer website, SaaS project, or content-driven platform, I would be happy to share practical experience and optimization suggestions.
Ideal For:
✅ Technical bloggers
✅ Independent developers
✅ SaaS website owners
✅ Content creators seeking organic traffic growth
✅ Website owners interested in monetization opportunities
What I Offer:
✅ WordPress Performance Optimization
✅ SEO Consulting
✅ Multilingual Website Setup
✅ Ad Revenue Optimization
✅ Blog Growth & Monetization Consulting
If you would like to discuss your website, traffic growth strategy, or monetization opportunities, please contact me and mention: Blog Growth Consultation.
Contact Me:
Telegram: @shuijingwan
WeChat: 13980074657
Email: shuijingwanwq@gmail.com


Leave a Reply