How to insert Google AdSense Code in WordPress Website? (Updated 2023)

image via How to insert Google AdSense Code in WordPress Website.

No doubt inserting Google AdSense code into the WordPress site is an easy task. Different plugins are available; in which we can insert Google AdSense code in WordPress.

But here we discussed how to insert Google AdSense code in WordPress manually. We won’t use any plugin to insert Google AdSense code in the WordPress header.

According to Google AdSense requirements, we have to insert code in the WordPress site header when applying for Google AdSense approval. After the approval, we also have to fix some errors such as the “Earnings at risk Problem”.

Solution: Insert Google AdSense Code in the WordPress site

Follow the instructions that are mentioned below then you will be able to successfully insert the Google AdSense code in the WordPress site header:

  • Copy the Google AdSense code
  • Go into the dashboard of the WordPress site
  • Click on “Appearance
  • Go into the “Theme Editor
  • Find the “Header.php
  • Paste the Google AdSense code in the head section.

Details:

Copy the Google AdSense code from the Google AdSense dashboard. Open the WordPress site dashboard and click on “Appearance” then go into the “Theme Editor”.

Image via a click on “Appearance” then go into the “Theme Editor”

You have to find the “header.php” on the right side. You have to find the head section and paste the Google AdSense code. Make sure you inserted the Google AdSense code between the head section.

Hope so your code successfully inserts but in some cases, Google bots have difficulty finding the code so you need to clear all caches as well as “delete cache and Minified CSS/JS”. For this purpose, install the “WP-Rocket” plugin.

Image via delete cache and Minified CSSJS

Alternative Method

If you don’t want to insert Google AdSense code manually then you can use WordPress Plugins. Go into the plugins and search “Insert header and footer”, the plugin will show. Just install and activate it.

Image via “Insert header and footer” plugin.

Open the “Insert header and footer” plugin and paste the Google AdSense code in the header section. Further, there are many plugins that allow you to add codes in the header and footer sections so we recommend you use this plugin.

Frequently Asked Questions

What are the methods for inserting AdSense code in a WordPress site?

Methods include using widgets, theme ad spaces, plugins, or manually inserting code into your site’s HTML.

How do I insert AdSense code using WordPress widgets?

Go to your WordPress dashboard, navigate to “Appearance” > “Widgets,” drag a “Custom HTML” widget to your desired widget area, and paste the AdSense code.

Which WordPress plugins can help me insert AdSense code?

Popular plugins include Ad Inserter, Advanced Ads, WP QUADS, and AdSanity. Install and configure the plugin according to the developer’s instructions.

How do I manually insert AdSense code into my WordPress theme files?

Edit your theme files (e.g., header.php, footer.php, or single.php) in the WordPress theme editor or via FTP, and paste the AdSense code where you want the ads to appear.

How long does it take for ads to appear on my WordPress site after inserting the code?

Ads should appear within a few hours, but it can take up to 48 hours for newly created ad units to display. Ensure your site is approved by AdSense and has sufficient traffic.

Final Thoughts

Inserting Google AdSense code with the help of a Plugin is an easy task but we recommend you use the manual method. Because plugins can affect website speed. Make sure you installed the plugins that your site really needs.

Related posts

How to Identify the Right Excel Developers & Analysts for your Business

From Wool to Synthetic Expert Strategies for Cleaning All Carpet Varieties

Safety and Efficiency: Implementing Autonomous Gas Boilers in Block of Flats