Adsense x WordPress: How to Avoid Ad Crawler Errors and Lost Revenue

Avoid Ad Crawler Errors and Lost Revenue

Google Adsense is an advertising program developed by Google that allows website owners to earn revenue by displaying ads on their websites. Adsense uses a pay-per-click model, which means that website owners earn money every time a user clicks on an ad displayed on their website, but ad crawler errors can cause WordPress admins headaches.

Adsense is a popular choice for website owners looking to monetise their traffic because it is easy to set up and use. Additionally, Adsense offers a wide range of ad formats, including text, image, and video ads, which allows website owners to display ads that are relevant to their audience and fit seamlessly into their website’s design.

When it comes to integrating Adsense into your WordPress website, you have several options available. One option is to use the official SiteKit plugin from Google, which allows you to easily connect your Adsense account and display ads on your website. This plugin is available for free in the WordPress repository and is regularly updated by Google.

Another option is to use a third-party Adsense plugin, such as Advanced Ads, Ad Inserter, or Easy Adsense Ads Manager. These plugins offer additional features, such as ad rotation, ad scheduling, and ad placement options, that can help you optimise your ad revenue. It’s important to note that third-party plugins may not be updated as frequently and may come with additional overhead and vulnerabilities that can slow down your website’s performance or put your website at risk.

Top 10 Adsense Plugins

  • AdSanity: AdSanity is a powerful plugin that allows you to insert Adsense ads, as well as other ad networks, into your website. It offers a wide range of features, including ad scheduling, ad rotation, and ad placement options, to help you optimize your ad revenue.
  • SiteKit by Google is a plugin that has been developed by Google, released in 2020. SiteKit is an all-in-one solution that helps you set up and manage your website’s analytics, search console, Adsense, and Tag Manager all in one place. It’s designed to simplify the process of setting up and managing your website’s Adsense ads and you can easily connect your Adsense account and start displaying ads on your website.
  • Advanced Ads: Advanced Ads is a popular plugin that allows you to easily insert Adsense ads, as well as other ad networks, into your website. It offers a wide range of features, including ad scheduling, ad rotation, and ad placement options, to help you optimize your ad revenue.
  • Ad Inserter: Ad Inserter is a powerful plugin that allows you to insert Adsense ads, as well as other ad networks, into your website. It offers a wide range of features, including ad scheduling, ad rotation, and ad placement options, to help you optimize your ad revenue.
  • Easy Adsense Ads Manager: Easy Adsense Ads Manager is a simple plugin that allows you to easily insert Adsense ads into your website. It offers basic features, such as ad placement options, to help you optimize your ad revenue.
  • WP QUADS: WP QUADS is a popular plugin that allows you to easily insert Adsense ads, as well as other ad networks, into your website. It offers a wide range of features, including ad scheduling, ad rotation, and ad placement options, to help you optimize your ad revenue.
  • Quick Adsense: Quick Adsense is a simple plugin that allows you to easily insert Adsense ads into your website. It offers basic features, such as ad placement options, to help you optimize your ad revenue.
  • AdRotate: AdRotate is a popular plugin that allows you to easily insert Adsense ads, as well as other ad networks, into your website. It offers a wide range of features, including ad scheduling, ad rotation, and ad placement options, to help you optimize your ad revenue. Additionally, AdRotate has a built-in statistics system that helps you track your ad performance.
  • WP Insert: WP Insert is a powerful plugin that allows you to insert Adsense ads, as well as other ad networks, into your website. It offers a wide range of features, including ad scheduling, ad rotation, and ad placement options, to help you optimize your ad revenue. Additionally, WP Insert also offers features such as ad targeting, ad blocking, and ad impression tracking.
  • AdThrive Ads: AdThrive Ads is a plugin that allows you to easily insert Adsense ads into your website, it’s built for high-traffic sites and offers advanced features such as ad optimization, ad testing, and ad revenue maximization. AdThrive Ads is a premium plugin, which means you have to pay for it, but it also offers a 14-day free trial.

Please note that these descriptions are intended to be a general overview of each plugin’s features and should not be considered as definitive. It’s always a good idea to check the plugin’s official website via the links above, read the documentation and do a Google search to read reviews before making a decision on which plugin to use.

It’s important to note that plugins available in the WordPress repository can come with additional overhead, vulnerabilities, and performance issues. These plugins often add additional scripts and styles to the website which can slow performance. It’s also possible that some plugins may have security vulnerabilities that can put the website at risk, either now or later if they are abandoned by their developer, which is not uncommon.

So what’s the solution, I hear you cry in anguish?!

Google Adsense on your WordPress Site via functions.php

Google Adsense is a powerful tool for monetising your website and earning revenue through advertising. With Adsense, you can display text, image, and video ads on your website, and earn money every time a user clicks on one of these ads.

One way to include Adsense on your WordPress site is to use the functions.php file. By adding a snippet of code to this file, you can include Adsense ads on your website without the need for additional plugins. This approach can be especially useful for developers who prefer a streamlined website with minimal overhead and vulnerabilities.

If you’re a developer who values a streamlined WordPress website, the following line of code in your functions.php file can help you show Adsense ads without any extra bloat.

add_action('wp_footer', 'adsense_code');
function adsense_code() {
?>
<!-- We run Adsense code to deliver ads, thanks to https://www.www.aiospark.com -->
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-XXXXXXXXXXXXXXXX"
     crossorigin="anonymous"></script>
<!-- so ends the adsense code -->
<?php
} 

This code adds a function called adsense_code that is executed in the footer of your website. Replace ca-pub-XXXXXXXXXXXXXXXX with your publisher ID.

However, there is a potential issue with this code. When you deploy this code, you may run into issues with Google’s Adsense “Adcrawlers” bots that will notify you of “You have ad crawler errors, which can result in lost revenue.”

This is because you’ll be serving ads to yourself while you build the site or write an article/page and view it in Preview Mode before publishing it. If you’re like most developers, you’ll do that quite a bit, which might rack up 50 or so infractions on the “page not found” ad crawler detection system.

Solution: Make it ‘Non Admin’-only!

One of the most effective ways to avoid the ad crawler errors that can occur when using Adsense on your website is to exclude Adsense ads from being displayed to admin accounts.

By using an “if this user has access rights to modify a post, don’t show the ads, otherwise do” statement, you can ensure that Adsense ads are only displayed to non-admin users, which eliminates the possibility of ad crawler errors.

This not only ensures that your Adsense account remains in good standing with Google, but it also provides a better user experience for your website visitors, as they will not be bombarded with ads when they are logged in as an admin.

This simple solution is worth its weight in gold as it eliminates the potential lost revenue and potential penalties from Google.

/* Run Adsense code without the bloat */
if ( current_user_can( 'manage_options' ) ) {
    /* Don't show the Adsense ads */
} else {
    add_action('wp_footer', 'adsense_code');
    function adsense_code() {
    ?>
    <!-- We run Adsense code to deliver ads, thanks to https://www.www.aiospark.com -->
    <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-XXXXXXXXXXXXXXXX"
         crossorigin="anonymous"></script>
    <!-- so ends the Adsense code -->
    <?php
    } 
}

This code checks if the current user has access rights to modify a post. If the user does, the ads will not be shown. If the user does not, the ads will be shown as per the previous code.

This will only serve ads to non-admin users, meaning those errors will disappear, and you’ll be back to no errors on your account. Problem solved.

In summary, using a simple line of code in the functions.php file, you can avoid the bloat, vulnerabilities, and performance issues associated with Adsense plugins, while also avoiding ad crawler errors by only showing ads to non-admin users.

If you found this post helpful, please share it with your peers and consider subscribing to our blog for more helpful tips and tricks.

Final thoughts

Including an if statement that excludes Adsense from displaying to admin accounts is a crucial step to avoid ad crawler errors and lost revenue. By only showing ads to non-admin users, you ensure that the ads are only displayed to your website’s actual audience, rather than to yourself and other members of your team while you work on the website.

Not only it will prevent the ad crawler errors but it will also provide a better user experience to your website visitors, as they are the ones who are most likely to click on the ads and generate revenue.

This approach helps to keep your Adsense account in good standing, avoiding any penalties or suspension from Google. In short, implementing this small but essential step in your Adsense integration can save you from a lot of headaches, ad crawler errors and lost revenue in the long run. All the best!

Like that? Try these

The Power of Local SEO for UK Small Businesses (Part 2)

Part 2 of our series delves into the transformative power of local SEO for UK small businesses. Learn key tactics for enhancing online presence, attracting more local customers, and boosting business growth.

Claude’s Social Media Marketing Guide | 2024

This guide examines the top platforms to prioritize, how to create an effective social strategy, tips for optimizing content for each platform, social media advertising methods, and the best practices brands should follow.

The Importance of Local SEO for UK Small Businesses (Part 1)

Local SEO helps small businesses rank higher for local searches. But with intense competition, how can your business stand out locally? Learn the benefits and challenges of local SEO for UK small businesses.

Developing Personas: A Key Component of UX Design

Want to make your UX Design more effective? Our in-depth guide on developing personas in marketing offers actionable insights for better audience targeting and engagement.

Boost Your Small Business: Top 4 Advantages of Professional Website Design

Keen on propelling your small business to new heights? Discover how professional website design serves as a catalyst, unfolding five game-changing advantages. The first impression counts; make yours unforgettable.

Mastering Technical SEO: A Comprehensive Guide to Overcoming Common Issues

Embark on a transformative journey with AIO's guide on Mastering Technical SEO. Uncover common issues and actionable solutions to rank higher in search results and provide an optimal user experience.

AIO Guide to Summarising Industry Reports

Embark on a journey to master the art and science of summarising industry reports with AIO's guide. Transform verbose reports into a treasure trove of actionable insights for your SME's sustained growth.

Simplifying Academic Writing with AI: A Guide to Abstract Generation

Unlock the full potential of your academic research with AI-generated abstracts. Say goodbye to the pains of manual abstract writing and embrace the future where AI does the heavy lifting, allowing you to focus on what truly matters—your research.

Google Bard September 2023 Update

Stay ahead of the curve with Google Bard's September 2023 update. From real-time information to enhanced language support, discover how Bard is becoming an indispensable tool for content creators.