class="post-template-default single single-post postid-15659 single-format-standard wp-embed-responsive right-sidebar nav-float-right one-container header-aligned-left dropdown-hover" itemtype="https://schema.org/Blog" itemscope>

how to add adsense verification code in wordpress

Here are the steps on how to add AdSense verification code to your WordPress website, with images to guide you:

1. Obtain the AdSense verification code:

  • Log in to your AdSense account.
  • Click on the “Sites” tab.
  • Select the site you want to verify.
  • Click on “Verify”.
  • Copy the verification code provided. It will look similar to this: <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-XXXXXXXXXXXXXXXX" crossorigin="anonymous"></script>

2. Choose your preferred method:

Method 1: Using a Plugin (Recommended for beginners)

  • Install and activate the “Insert Headers and Footers” plugin.
  • Go to Settings > Insert Headers and Footers.
  • Paste the verification code into the Headers section.
  • Click Save.

Method 2: Editing the Theme Files (For experienced users)

  • Access your WordPress theme files using an FTP client or your hosting provider’s file manager.
  • Locate the header.php file within your theme’s folder.
  • Open header.php in a text editor.
  • Paste the verification code within the <head> section of the file, before the closing </head> tag.
  • Save the header.php file.

3. Verify your site:

  • Return to your AdSense account and click Verify.
  • AdSense will check for the code on your website.
  • If successful, you’ll see a confirmation message.

Additional tips:

  • If you’re using a caching plugin, clear your cache after adding the code.
  • If you’re still having trouble, refer to AdSense’s official help documentation for more detailed instructions.
  • Consider using a child theme to make changes to your theme files, as this prevents your modifications from being overwritten during theme update

Leave a comment