Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

How to Properly Add Google AdSense to Your WordPress Site

Google AdSense is one of the easiest ways to earn money from your website. Over the years, we’ve guided many bloggers through monetization struggles, and AdSense has proven to be a dependable solution.

With Google AdSense, you can automatically sell your website’s ad space to advertisers and get paid. The best part? There are virtually no requirements to get started, making it accessible to bloggers of all levels.

Whether you’re a seasoned blogger looking to diversify your income streams or a newcomer eager to start making money online, Google AdSense offers a fantastic opportunity.

In this article, we’ll show you how to add Google AdSense in WordPress, along with some best practices and tips we’ve learned that can help you increase your earnings.

How to Add Google AdSense to WordPress site

What is Google AdSense?

Google AdSense is an advertising network run by Google that allows bloggers and website owners an opportunity to earn money by showing text, images, videos, and other interactive advertisements on their websites. These ads are targeted by site content and audience, so they’re highly relevant.

Google AdSense is hassle-free because you don’t have to deal with advertisers or worry about collecting money. Google administers and maintains relationships with advertisers. They collect the payment, take their management fee, and send the rest of the money to you.

AdSense offers cost-per-click ads (CPC), which means that you earn money every time a user clicks on an ad on your website. The amount received per click varies based on a variety of factors.

Getting Started with AdSense

The first thing you need to do is sign up for a Google AdSense account. If you have a Gmail account, then you can use your existing account to sign up.

Once you’ve submitted your application, you will need to wait for the Google AdSense team to review it. This may take a few hours to a few weeks for some publishers.

Once it is approved, then you can log in to your AdSense account and get your ad code. This is the code that you need to place on your WordPress website to display ads.

With Google AdSense auto ads, you can paste just one piece of code and then Google automatically decides when, where, and how many ads to show on each page.

However, many publishers use the manual method to individually place ads on their websites.

We’ll show you both methods. We recommend starting with the manual ad placement first. Once you have started earning, then you can experiment with auto-ads to compare them yourself.

Video Tutorial

Subscribe to WPBeginner

If you’d prefer written instructions, just keep reading.

1. Manually Place Google AdSense Ad Code in WordPress

You’ll start by clicking on the Ads menu in the left column and then switching to the ‘By ad unit’ tab. From here, you need to click on ‘Create New Ad.’

You will be asked to choose an ad type. You can select from Display ads, In-feed ads, and In-article ads.

If you are unsure, then start with the display ads.

Choose your unit

Next, you need to provide a name for this ad unit and select the ad size and type.

Enter details and select size

The name of the Ad is only used for internal purposes so you can name it anything like “SiteName Sidebar.”

The next option is choosing the Ad Size. While Google offers a wide variety of ad sizes, there are certain sizes that are listed under recommended because those are the most popular among advertisers. See our guide on the best Google AdSense banner sizes for more details.

You can also choose whether you want your ad to be responsive or fixed. We recommend choosing responsive ads as they work well on all devices and screen sizes.

Next, click on the ‘Create’ button to continue.

AdSense will now generate the ad code for you. It contains the unique ad unit ID and your publisher ID.

Copy the code

Simply copy your ad code and paste it into a plain text editor like Notepad or TextEdit. You will need it in the next step.

Adding Google AdSense in WordPress

Next, you need to determine where you want to show the ad on your website. Ads are most commonly displayed in the sidebar. You can add Google Adsense to your sidebar by using WordPress widgets.

Simply go to the Appearance » Widgets page in your WordPress admin area. Next, click the ‘+’ button to add a ‘Custom HTML’ widget block to the appropriate widget area.

Add custom HTML widget block

Next, you’ll need to enter the Google AdSense code in the Custom HTML widget block.

After that, don’t forget to click the ‘Update’ button.

Enter code and update widgets page

For better placement control and tracking, we recommend checking out a WordPress plugin like Advanced Ads or AdSanity.

You can see our guide on the best ad management WordPress solutions for more details.

2. Add Auto-Ads AdSense Code in WordPress

Adding individual ads to different areas of your website takes a lot of time. Most beginners struggle to find the best locations to display ads on their sites.

To solve this, Google introduced auto-ads. This allows you to simply add one code snippet to your site and let Google AdSense figure out the highest paying location, ad size, and type.

The disadvantage of this method is that you have less control over ad placement on your website.

If you want to use the auto-ads feature, then this is how you’ll add Google AdSense to your website.

First, log in to your Google AdSense account and click on the Ads tab. Next, you need to click on the ‘Get Code’ button to generate the auto-ads code.

Get code for auto placement

AdSense will now generate a code snippet with your publisher ID and display it. You can now copy and paste this code into a text editor.

Copy and paste the code

Adding AdSense Auto-Ads Code in WordPress

The auto-ads code uses a single code snippet to generate ads everywhere on your WordPress blog. This means you need to add the code to all the pages where you want to display the ad.

One way to do this is by adding the code to your WordPress theme’s header.php file. However, the disadvantage of this method is that your ad code will disappear if you update or change your theme.

The best way to add any site-wide code to your website is by using a plugin like WPCode.

WPCode

WPCode makes it safe and easy to add header and footer code in WordPress, without editing your theme files. This means that you’ll be able to save your ad code even if your theme changes.

First, you need to install and activate the free WPCode plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

Note: The free version of WPCode has everything you need to add custom code snippets to your site. However, if you want advanced features like conversion pixels, scheduled snippets, code revisions, and more, you can upgrade to WPCode Pro.

Upon activation, go to the Code Snippets » Header & Footer page. From here, you need to paste your Google AdSense code in the header section.

Paste Google Adsense code in the header using WPCode

Don’t forget to click on the ‘Save Changes’ button to store your changes.

The plugin will now add the ad code on all pages of your website. It may take Google AdSense some time to start showing ads.

Related: See our guide on how to add header and footer code in WordPress for more details.

You can also use the WPCode plugin to automatically display Google AdSense ads in specific areas like before the beginning of a post, after a post, before or after a paragraph, and more.

For step by step instructions, see this guide on how to insert ads within your post content in WordPress.

AdSense Best Practices and Frequently Asked Questions

Over the years, we’ve answered several AdSense-related questions. Having used AdSense on several of our sites in the past, we’ve learned a whole lot about optimizing. Below are some AdSense best practices and frequently asked questions.

What’s the best AdSense Ad Size?

Although ad placement is key, we’ve found that the best sizes are 336×280 and 300×250. These ads tend to fit on most screen sizes and have the best pay rate as well.

To learn more, see our guide on the highest performing Google AdSense banner sizes.

What’s the Best AdSense Placement?

This entirely depends on your layout. The goal is to get more impressions and clicks, so you want to place your ads in a more prominent spot. We have found that ads within post content toward the top of the screen tend to get the most clicks.

Several users have asked us about adding AdSense in a floating widget because it will be very prominent. We strongly recommend against that because it is not allowed by Google Terms of Service. If you violate their TOS, then you can get banned from the program.

Can I click on my own Google AdSense Ads?

Often beginners are tempted to click on their own ads or ask their family members to click on their ads. Please don’t do that. Google’s algorithm is very smart and knows when you’re clicking on your own ad. This can get you banned from the program.

To learn more, see our guide on how to prevent invalid AdSense clicks in WordPress.

What is Page RPM in Google AdSense?

RPM stands for Revenue per Mille, meaning revenue per 1000 impressions. This is determined by multiplying the total number of clicks and cost per click and then dividing that by the total number of pageviews.

Can I use my Blogger or YouTube AdSense account with WordPress?

Yes, you can. If you started using AdSense on one of Google’s hosted platforms like Blogger or YouTube, then you can change your AdSense account type and use it with WordPress. You’ll need to provide Google AdSense with the URL of the site you want to monetize by filling out an application form.

Simply log in to your AdSense account and then under ‘My Ads’ click on the ‘Other Products’ option. Next, you need to click ‘Upgrade now’ and complete the application form.

What is CTR in Google AdSense?

CTR or click-through rates differ vastly for different kinds of websites. Your ad clicks depend on a lot of factors, like your website’s topics, your audience type, ad placement on your site, and more. The ideal CTR for Google AdSense is really hard to define because you don’t have access to the click rates of other websites like your own.

However, Google AdSense has built-in tools that will start showing you messages if your site is not getting a good CTR. You can follow the optimization guides shown inside the Google AdSense dashboard to improve your ad revenue.

You may also want to see our guide on how to set up Google Ads conversion tracking in WordPress.

When and how does Google AdSense pay publishers?

Each month, Google AdSense calculates your previous month’s earnings and shows them on your ‘Transactions’ page. If your earnings match the required threshold, then your payment is processed and released by the 21st of that month.

There are multiple payment methods available, including direct electronic transfer, wire transfer, check, Western Union, and more.

Why did Google AdSense reject my application?

Google Adsense may reject your application if your website is brand-new or otherwise doesn’t meet the AdSense program policies or their terms and conditions.

If they do, you could always consider using another ad management plugin or try another way to make money with your WordPress site.

What are the requirements to get Google AdSense application approved?

Here are the minimum requirements to get your Google AdSense account application approved.

  • Your website and all its content must comply with AdSense program policies and terms and conditions.
  • Your website should be at least 6 months old.
  • You, the applicant, must be over 18 years old.

Note: Even if your application meets all the requirements, Google AdSense still reserves the right to decline your application.

Can I add Google AdSense in my WordPress.com blog?

WordPress.com does not allow you to add Google AdSense to your website unless you upgrade to the Business plan. For more on this topic, please see our guide on the difference between WordPress.com vs WordPress.org.

What is the difference between Google AdSense vs Google AdWords?

Google AdWords allows you to advertise on other websites, including those participating in the Google AdSense program.

Google AdSense allows you to make money from your website by showing ads on your website.

How do I get rid of Adsense Ads?

If Google Adsense is displaying too many ads or you’re seeing ads in random places on your site, you’re probably using Google Adsense Auto ads.

To turn off Auto ads, sign in to your Adsense account and go to Ads » Overview. Next, click on the ‘Edit’ icon next to your website. You can disable the Auto ads options in ‘Site Settings’ to completely remove Auto ads on your site. Or, you can select the ‘Page Exclusions’ option to disable Auto ads from specific pages.

We hope this article helped you add Google AdSense to your WordPress site. You may also want to check out our guide on how to increase your blog traffic and the best email marketing services to grow your subscribers.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

464 CommentsLeave a Reply

  1. Victoria

    Hi i am getting this message from google saying “Site does not comply with Google policies”

    My site is

    Any idea’s?

  2. Sheila

    When I first started using adsense for my blog it was pretty straight forward to ad the code. I had to shut down my website and applied for to ad code to a new site. I got the approval and when I tried to ad the code it does not show on my new website. I thought I had to set up a new ad unit and after doing that got the code and when I copy to my website it does not appear. My wordpress theme is Woothemes. Does it not work with that theme?

  3. Howard

    First off, does one have a choice as to WHAT ads you want to display? Are they permanent and/ or do you update and/ or delete ads or is this automatically done by Google? Does ad sense have ANY relevance as to a blogger taking his OWN display ads from companies that may wish to do so… Or, does ad sense give you the layout and codes for an advertiser who directly wants a space made for his product on your blog site??? ( or is there better ways to take your own direct display ads from companies that may want to pay you for them )??
    Big questions , no?
    Thanks, need a good answer.

    • Rachel

      It’s automatically done by Google. They display ads based on the user (the person visiting your site). If you want to display ads from a company you have some deal with, you’ll need a different solution.

  4. Megan

    Hi, so I’ve followed all the instructions but as soon as I click “save” for my ad code in the text widget it changes the code and gets rid of the ” ” and all the shows on my website is the actual text from the code.

    I’m unsure how to fix this problem. Any and all suggestions are welcome! Thank you!

    • Scott

      Did you ever get a reply to this or figure out a solution, because the exact same thing is happening to me.

    • LEWIS

      Hello. Make sure the “automatically add paragraphs” box is unticked…

  5. Ramesh

    i have adsense on my wordpress website. i have posted ads in my all posts. but one of my sidebar ads not showing now. it showed for last 4-5 days but now showing now. can you plz tell me the reasons ?

  6. Richard

    I have domain in wordpress, but when Im apply for adsense they gave me am answer ‘the adsense not approved because the language is not supported by google. What can I do?

  7. Amy

    Hi, I have only just begun exploring blogging and AdSense this week. Following the instructions in this post, I created an AdSense account today, was momentarily distracted, and accidentally clicked on the wrong button when asked if I accept AdSense’s Policy or not. (I accidentally said no!) This will no doubt result in my application being rejected.

    My question is, will I be able to apply again?

    I have not been able to find a way to log in to my application and change my response.

    Any replies would be greatly appreciated.

    Thanks for your time!

  8. Anish kumar

    Hi,
    i have a doubt .My doubt is if i am using ads in our site so google will be charged or not for ads

  9. ranjit

    i have website i am using wordpress.. i am waiting 2nd stage adsence approval process from last 3 month. 3rd april i got the mail behalf of google review successful pls add first add unit… i have added /// but i dont know whats going wrong… why taking too much time for 2nd stage aproval process.

  10. Austin

    I followed your steps to the “T” on WordPress.org using the sidebar widget. It did not work. I have a YouTube Adsense account, so I added my website/blog to AdSense as a non-host I have a few questions:

    (1) Do you have to wait six months before AdSense will consider your add.
    (2) Do you have the link so I can see if Google has my website to add to Adsense?
    (3) When I followed your instructions. nothing appears on my end to indicate that it was successful. Therefore, I waited and waited. Still nothing.
    (4) Why is your directions to add AdSense on WordPress not the same as others directions found on videos or websites? I tried the other methods. It did at least show something (empty space, box that says “Ad will go here,” etc., but no ad would appear

    Thank you in advance.

  11. Jitendra

    How much time to code display my ad on my website.

  12. venkanna

    how much time time to disply ads in website

  13. vijay

    Can I place ad on free theme?

  14. Jenniffer

    Hello,
    I bought the domain for my website in Wordpress, but not the host. In order to use google ads or any type of ad, do I need a host?
    Thank you!

  15. Suji

    hi

    i placed my adsense code yesterday (5/7/2016) in my website using wordpress widgets, however google is sending mail that

    “You’re almost there! To get your site ready for review by our team, copy and paste the ad code found in your AdSense account onto your website”

    but i already placed adsense code in my website.. what shall i do now?

  16. karan dhingra

    i have done settings & placed adds through google adsense plugin….& it is showing blank space at that place….should i also place code to widgets area or adds automatically will start showing after 2 process of approval!!!??

  17. Kumarkranthy

    Hi Team,

    I have added the add to my site, but the add is not showing, the below is the message im able see.

    Please help!!

    From
    Kumar

  18. dymang

    Hey, i have example.wordpress.com is this possible to make a google adsense?

  19. Manoj Kumar Sethi

    Hi,

    Is it possible to run ads in wordpress.com site ?

  20. Bron

    Dear Team,
    After trying to fix my issue with Google support team (no reply), Wordpress support forum (no help) and by my own, i’m lost now!

    I have an issue trying to fix since 2 weeks! Now i’m really tired.

    The problem is like this:
    – My account is properly connected to Google Adsense, but i can’t see any ads on my page except 1 page (category)
    – I use categories as menus, only 1 category shows the ads.
    ( I would like to send to you my site url, but i don’t know if you allow that here)

    Just to explain a little what i’ve done so far:
    1. I’ve connected my site to google adsense through Google Adsense plugin (by Google)
    2. It started to work, than 3 days later i tried to change the footer credits on my theme. After that my ads started to disappear! Strange!
    3. Tried all those option:
    – Re-install plugin,
    – Re-connect to adsense,
    – Re-install my wordpress (completely fresh),
    – Change theme,
    – Change permalink (by changing permalink it started to work again for a few hours than disappeared again);
    – Changing the site url (added www to my site url), worked for 1 day than disappeared again.
    – Manually inserted code (through widget text)

    I use this plugins:
    – Google Adsense
    – Advanced Ads
    – Google Analytics Dashboard for WP
    – Infolinks Official Plugin
    – Jetpack by WordPress.com
    -WP Super Cache (recently installed, two days ago)
    (Tried also to deactivate all plugins, no success)

    I would really appreciate your help.

    Best Regards,

    • WPBeginner Support

      Login to your Adsense account and manually generate an Ad code, then paste that code in your theme. If this works out, then it could mean two things. A plugin you are using, does not have a publisher ID. Check your plugin settings to make sure it uses your publisher ID with ads.

      Admin

      • BRON

        Hi,
        Already tested that, but the ads are not showing. The ad is showing only in one page (category).
        Can you PLEASE inspect my page if you find something?

        Thank you

      • Bron

        Dear WPBeginner team,
        Since i’m lost on trying to fix this, can we have a privat contact and i’m ready to pay for your service, if you could fix my issue. Also i’ll give you the admin access. I don’t think it’s an Google issue because i see the ads on 1 page (category), it should be something wrong in my root site.

        I hope that my message will have your consideration!

  21. Ronnie Appiah

    My posts cannot link to its associate categories, when I click on any category it takes me back to homepage. I Need your help seriously

  22. sandy

    i am trying to figure out how to make my backup ad into my amazon.com ad and this post was no more help than google’s own help. theirs is too technical and yours didn’t even go there.

  23. Oluseye

    URGENT PLEASE!!!

    I followed this guide critically and i was about to save the added generated code on a text widget, but got this notification

    “A background request to WordPress was just blocked for the URL /wp-admin/admin-ajax.php. If this occurred as a result of an intentional action, you may consider whitelisting the request to allow it in the future”

    there was options to whitelist and cancel.
    Should I whitelist??

  24. siddhartha.

    i have free domain with WordPress did it works on my dimain.

  25. Carly

    What Theme do you use for your site? I’m finding that my posts just stack on top of another in a never-ending stream of blog posts. How do you stop each post and have a comment box at the bottom, just like this article on your site?

    • WPBeginner Support

      Try switching to a different WordPress theme by clicking on the Appearance Tab in WordPress admin area. You can also click on a post’s title to see the single post.

      Admin

  26. SALMAN

    How to ad adsense ads into image galrry

  27. Renato Zurita

    Hey there, after following your steps, nothing appears while adding the code to the “Text” on the sidebar. Adsense tells me this: “In order to complete your request to show ads on your own website, you need to implement the ad code on beelucky.net. Your upgrade request can only be reviewed once your ad code has impressions on that domain.” Any help you can give me?

    • Prob Pob

      That means your adSense request hasn’t been approved yet ! Once, you are eligible, the google Adsense will automatically display your add. Best wishes.

  28. KEWAL

    Your post are very good and user friendly language.

    Blogger delete my blog which is approved by Google adsense.

    One week ago I started again with Wordpress.org. My adsense account is still open with You tube. Do I can start placing adsense ads on my blog or wait for next six month as per adsense policy. Please help me.

    Thanks & Regards,
    Kewal Krishan

  29. Vanessa

    So I did all these steps and still have blank spots where the ads should be (in the text widget). Adsense says that I need to Upgrade to put adsense on Wordpress since it isn’t a “hosted partner”. It’s saying to be approved to have it on my page I need to have it authorized, but now a message comes up saying it cannot be authorized til I get ad impressions on my page. It also says something about receiving a PIN in the mail? I’m very confused. Trying to put this on both of my wordpress pages. Thank you for any help!

  30. Byron

    Alright, so I posted the ad code into a text widget but I ended up with this gook on my blog:

    //pagead2.googlesyndication.com/pagead/js/adsbygoogle.js
    (adsbygoogle = window.adsbygoogle || []).push({});

    What’s the deal here?

    • Me Too

      Yeah I got the same deal it doesn’t work like that does it?

  31. Nora

    I found this on WordPress Support: Advertisements, including those from third-party advertising networks like Google AdSense, OpenX, Lijit, BuySellAds, and Vibrant Media are not allowed on WordPress.com.

    So how can I do it?

  32. M

    I’m using wordpress.com. I’ve put the code in the text field, but everytime I save it, the code is automatically altered. As a result, I only have a string of codes on my blog. How do I fix this?

  33. Akiv

    This is my site. Its a WordPress theme. In its blogs, i want to show ads next to the image or wrapped by text content. Which i am not able to do. I am not liking where i am placing ads atm. Can anybody help?

  34. anand

    i had already placed ad code in my widget are..still there is nothing showing….also not blank ad…and google says…”In order to complete your request to show ads on your own website, you need to implement the ad code on. Your upgrade request can only be reviewed once your ad code has impressions on that domain.”
    What should i have to do?
    Thanks in advance

  35. sudipto

    In some days I have face a problem. in my blog i put here google adsense but sometime the adds are not sown….

  36. Buzz

    But how much money can you get per, say, 1,000 views? Is it solely based on the number of clicks people give you?

  37. Chris Franklin

    Thanks so much! You made it SO easy to ad this code.. I couldn’t figure it out without you!

  38. Kerry

    I’m just getting the text in my footer (it keeps automatically changing when I press save I don’t know if that’s anything to do with it?) but the ad isnt appearing.

    Help!

    Thanks
    Kerry

  39. Anubhav

    Great article Editor but i have an unusual issue . i created an adsense account today and it said that you have to put code on your site . i placed it , ad displayed for some time and then disappeared , now it is showing only blank space and on the adsense account showing adunit as active .Did you came across such issue ?

    How can i fix it ?

  40. Prince Jain

    Hi,

    First Step is approved for my wordpress news site. To place ads, I added Google Adsense official plugin and set the ads location.

    Do I still need to add the code on my wordpress site to complete the approval process?

  41. Yungextt

    what type of advert do i get paid when someone just click on the Ad?
    Because some Ad might require for people to sign up,,buy a product before you get paid

  42. tamanna

    will try it out now

  43. Harpreet Singh

    Is it necessary to place Adsense code in each & every page. And whenever we post (new post) so there we also have to repeat this task again & again. Just want to clear on this funda? Please help me??

  44. Akarsh P K

    I am unable to add google adsence ads to my site. I tired the above steps and could not fetch any results. Please help.

  45. Amit kumar

    very very helpfull article sir,,,
    i think ad injection plugin is best for adsense management

  46. Hemant

    Hello,
    i have lot of trouble with my adsense account but there is no way to contact google.
    First will you please tell me exactly how to add adsense code to wordpress blog in approval process ?

  47. kris baker

    hi. do I need the premium version of wordpress or the business version in order to add google adsense????

  48. Soul of Sneakers

    Currently my blog is under free sub domain in wordpress…

    Can i put ads in it or do i need to have a custom domain? means go for premium account?

  49. Maia

    Hi, I’m using wordpress.com, can I add adsense to my blog? I’m already approved but don’t know how to add it on my wordpress.

    • Miguel

      From what I learned you go to appearence, widget, then text and input your code in there and your able to drag it to where you want it like content bar or side bar etc. But my ad is a yellow block. I dont know what went wrong.

      • Sgr

        Did u get a reply? Did you get it to work?

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.