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”.

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

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.

Methods include using widgets, theme ad spaces, plugins, or manually inserting code into your site’s HTML.
Go to your WordPress dashboard, navigate to “Appearance” > “Widgets,” drag a “Custom HTML” widget to your desired widget area, and paste the AdSense code.
Popular plugins include Ad Inserter, Advanced Ads, WP QUADS, and AdSanity. Install and configure the plugin according to the developer’s instructions.
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.
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.

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 Use a Facebook Video and Reel Downloader

OnlyMP3 Review: What You Need to Know About This Free YouTube to MP3 Tool

Common Mistakes to Avoid in a 360 Product Shoot