Search
Clear search
Close search
Google apps
Main menu

Troubleshoot and resolve common issues

How to check if your ad code has been modified

Modifying your AdSense ad code is not only against our program policies, but it may also result in errors on your site such as ads showing incorrectly, or not showing at all.

If you're using a WordPress site and pasting ad code into the WordPress editor box, sometimes your ad code can become modified. This can result in ad serving issues. We recommend that you use the AdSense Plugin for WordPress which will ensure your ad code is implemented correctly.

If the ads on your site are not serving, or they're serving incorrectly, you might want to check that your ad code is implemented correctly. You can do this by following these steps:

  1. Open a code comparison tool. If you don't already use one, we recommend you do a Google search for "code comparison tool”, then select one of the many free options.
  2. Open the source code of your site and locate the ad code that's not serving ads correctly.
    To locate the ad code, try searching for either the ID of the ad unit, e.g., 1234567890, or your publisher ID, e.g., pub-1234567891234567.
  3. Copy the ad code and paste it into the first text box in your code comparison tool.
    Note that the ad code should begin with <script async src= if you're using asynchronous ad code, or <script type="text/javascript"> if you're using synchronous ad code, and both types of ad code should end with </script>.
  4. On the My ads page in your AdSense account, find the ad unit that you're having a problem with and click Get code. The "Ad code" box containing the ad unit's ad code loads.
  5. Copy the ad code and paste it into the second text box in your code comparison tool.
  6. Click the compare button in your code comparison tool and review the results.

Checking the results in your code comparison tool

If your ad code has been implemented correctly, you typically won't see any differences highlighted by the code comparison tool. If you're still having issues with your ads, please refer to our ads troubleshooter for more help.

If your ad code hasn’t been implemented correctly, you'll typically see the differences highlighted by the code comparison tool. For example, you might see differences in your ad code such as:

  • Your ad code does not appear in its entirety, e.g., there's a missing <script> or <ins> tag.
  • Your ad code displays all on one line.
  • Your ad code has extra HTML tags within it.
  • The variables in your ad code (such as google_ad_height or google_page_url) have been renamed or changed.

Fixing issues with your ad code

You can fix any modification errors you find in your ad code by following these steps:

  1. Remove the ad code that's not serving ads correctly from your site. 
  2. Copy and paste the correct ad code from your AdSense account.

After you've correctly implemented your ad code, ads will begin serving within 48 hours (provided that your account status is active, and your site is policy compliant).

Was this article helpful?
How can we improve it?
Sign in to AdSense

Sign in to AdSense to see help for your account

Don't have an AdSense account? Sign Up for AdSense!