How to fix the error “Only one ‘enable_page_level_ads’ allowed per page”

One AdSense issue that we regularly encounter in support is the error adsbygoogle.push() error: Only one ‘enable_page_level_ads’ allowed per page.

In this tutorial, I will explain what causes this error, what consequences it has for your website, and how you can fix it once and for all.

What causes this error message, and how does it affect your website?

Contents

The error Only one ‘enable_page_level_ads’ allowed per page is showing up when you inject the verification/auto ads code from Google AdSense multiple times into your website. This warning is almost identical in cause and effect to the warning Only one ‘AdSense head tag supported per page.

We regularly see pages with this message, and the ads are displaying without any problems. So this warning is not the reason if your ad spaces remain empty and no AdSense ads appear.

However, we encourage you to fix the cause of this error and remove any unnecessary code.

Your browser will show the warning “Only one ‘enable_page_level_ads’ allowed per page” when you inject the Google AdSense verification/ auto ads code multiple times

How to resolve the “Only one ‘enable_page_level_ads’ allowed per page” error?

To fix the error, you need to remove the unnecessary Auto Ads Code insertions from your website.

Find and identify the Auto Ads code

The quickest way to check the auto ads code injections is by opening the source code view of your website in your browser. Use the search function and search for “adsbygoogle” to jump directly to those injections.

See Also  How To Get Rid Of Pigeons In Attic

Example of the new AdSense Auto Ads code

 div {
	overflow: auto;
}

.shcb-language {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	-webkit-clip-path: inset(50%);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal;
	word-break: normal;
}

.hljs {
	box-sizing: border-box;
}

.hljs.shcb-code-table {
	display: table;
	width: 100%;
}

.hljs.shcb-code-table > .shcb-loc {
	color: inherit;
	display: table-row;
	width: 100%;
}

.hljs.shcb-code-table .shcb-loc > span {
	display: table-cell;
}

.wp-block-code code.hljs:not(.shcb-wrap-lines) {
	white-space: pre;
}

.wp-block-code code.hljs.shcb-wrap-lines {
	white-space: pre-wrap;
}

.hljs.shcb-line-numbers {
	border-spacing: 0;
	counter-reset: line;
}

.hljs.shcb-line-numbers > .shcb-loc {
	counter-increment: line;
}

.hljs.shcb-line-numbers .shcb-loc > span {
	padding-left: 0.75em;
}

.hljs.shcb-line-numbers .shcb-loc::before {
	border-right: 1px solid #ddd;
	content: counter(line);
	display: table-cell;
	padding: 0 0.75em;
	text-align: right;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
	white-space: nowrap;
	width: 1%;
}
]]>

<script data-ad-client="ca-pub-****************" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"> </script>

Code language: HTML, XML (xml)

Example of the old AdSense Auto Ads code

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <script> </script>

Code language: HTML, XML (xml)

Remove the Auto ads code placed with your theme or with other plugins

If the warning Only one ‘enable_page_level_ads’ allowed per page warning is showing up, please remember, if you added the AdSense code anywhere when you signed-up for AdSense.

That could be:

  • another ad management or a header/footer script plugin
  • an option in your theme
  • manually placed code in your theme files

I recommend removing these manual injections and keep the checkbox for this code integration by Advanced Ads enabled.

You can find this option in Advanced Ads > Settings > AdSense.

Video: 00:38min
Click on the preview image to load and start the video from YouTube. By clicking you agree that your information will be sent to and processed by YouTube, LLC, 901 Cherry Avenue, San Bruno, CA 94066, USA. Read more

The integration of Auto Ads through Advanced Ads has two decisive advantages over the other methods. Firstly, you can easily exclude the automatic insertion of Auto Ads on particular pages via a checkbox. And second, the Responsive Ads add-on can automatically convert this code into an AMP-compatible format and insert it on your AMP pages.

See Also  How To Attach Granite To Wood

If you use a caching plugin on your website, please, don’t forget to flush the cache. Also, ensure that you don’t place the AdSense Auto Ads code somehow else.

Disable Auto ads in Advanced Ads

When you added the AdSense Auto ads code with Advanced Ads and need to remove this injection, then navigate to Advanced Ads > Settings > AdSense, and disable the Verification Code & Auto Ads checkbox.

Resources

Rate this post
Back to top button