Please make sure that you visit Your AdSense Page, where you can find personalised information about your account to help you succeed with AdSense.

Code implementation guide

How to paste the ad code in your page

After you've copied the ad code from your AdSense account, the next step is to paste it in your page’s HTML source code.

How you do this depends on what tools you use to edit your site:

Note: Before adding the ad code to your page, make sure that your page complies with the AdSense programme policies. If your page doesn't comply with these policies, we reserve the right to disable ad serving to your site and/or disable your AdSense account at any time.

HTML editors

Many publishers use a design-enhanced HTML editor like Macromedia Dreamweaver (also know as WYSIWYG or "what you see is what you get" software).

To ensure your ads work properly, make sure that you paste the ad code into the HTML source code of your page using the editor's HTML view or HTML insert function. You might find errors if you paste your ad code into a WYSIWYG view such as a 'Design' view.

Once you've pasted your code, check for any additional tags inserted by the software or changes in the line breaks, as they might cause your ads not to show correctly.

If you can't find the HTML source code of your page in your editor, visit the Help Centre or support group for your HTML editing software.

Content management systems (CMS)

If you're using a content management system, check below to determine if your CMS has AdSense built in or if it supports a plugin that can help you to implement your AdSense ad code.

Sites with AdSense built in

CMS software with unofficial plugins

The following content management systems (CMS) use third-party plugins to insert AdSense ads on the pages generated by the system.

Google does not endorse or support these plugins. However, you can use these plugins as long as the ad code displayed on your page remains unchanged and is not altered by the plugin in any way.

WordPress user? Get help with adding AdSense code.

If you need assistance with a plugin, visit the official support forum of your service or the developer of the plugin. Note that Google is not responsible for malicious third-party plugins.

PHP sites

While AdSense ad code does contain JavaScript variable declarations, it's actually a block of HTML code compatible with most PHP sites. For help with implementing the ad code on a PHP site, we recommend searching for online resources using terms such as 'AdSense php'.

Get more help

If you have trouble implementing AdSense with a specific content management system, we recommend searching for the name of the CMS (e.g. Drupal, Wordpress, etc.) with 'AdSense implementation'.

You can also ask in the AdSense community if other publishers have solved similar problems, or contact your programme provider directly.

Was this helpful?

How can we improve it?
Clear search
Close search
Google apps
Main menu