Remove ads from WordPress

This manual helps publishers to remove all ads from their WordPress site, whether they are using our Advanced Ads plugin or another method.

If you are looking for a way to remove ads from specific pages or hide it from specific users only then please take a look at the disable ads manual.

Remove Google AdSense Auto ads

If you see ads in random places then you are probably using Google AdSense Auto ads.

You might have enabled them unintentionally or added the code multiple times to your site. There are two ways to disable them:

  1. Disable Auto ads under Ads > Auto ads in your AdSense account.
  2. Remove all instances of the AdSense Auto ads code from your site.

Follow the methods below to find all codes and remove them.

You can check if you missed any codes by opening the code view in your browser and look for Auto ads codes.

AdSense Auto ads changed their codes over time. All three below are still working.

<script async src=""></script>
     (adsbygoogle = window.adsbygoogle || []).push({
          google_ad_client: "ca-pub-1234567890",
          enable_page_level_ads: true
</script>Code language: HTML, XML (xml)


<script data-ad-client="ca-pub-1234567890" async src=""></script>Code language: HTML, XML (xml)


<script async src="<meta charset="utf-8">1234567890"
     crossorigin="anonymous"></script>Code language: HTML, XML (xml)

Video: How to find the AdSense Auto Ads code on a website

This video shows you how to identify AdSense Auto Ads code on your website.

Advanced Ads

When you are using Advanced Ads you can just disable the plugin and all ads will be gone from your site, including the AdSense Auto ads code.

You can also just disable all ads in the frontend for testing or other purposes without disabling the plugin. Just enable Advanced Ads > Settings > General > Disable ads > Disable ads in the frontend.

Please notice that when you used shortcodes to place ads manually, you would need to remove them. Otherwise, you might see them in your content.

Other ad plugins

Other ad management plugins work similarly to Advanced Ads. They are not leaving any traces in the frontend of your site, except manually placed shortcodes. You can use a plugin like this one to remove old shortcodes.

You might not use a dedicated ad plugin but maybe one that allows you to add code to the header or footer of your site. Check their options or disable them to remove ads from your WordPress site.



Some themes have ad options, too. You might find a setting in the theme options or on the individual page settings. Disable or clear those options to remove ads from your WordPress site.

Theme files

Some ad networks ask you to place ad code in theme files, especially in the header. If you think that this happened in your case then check the files under /wp-content/themes/[your-theme]/. The most common file with any ad content in it is the header.php.

Editing theme files directly can result in critical errors so make sure to have a backup at hand.

Instead of manually editing your theme, you could also get the latest version from the source and install it. This makes sure that all customizations are removed. Of course, you’d need to be sure that you are not removing code that is still needed.

Page builder

Page builder plugins or those integrated into theme could also host ad codes that you need to clear to remove ads from WordPress. Check the individual pages but also templates, if the theme builder has them.

Subscribe to our newsletter and get 2 add-ons for free!

* indicates required


If you want to remove ads from your sidebar you need to check the widgets under Appearance > Widgets for any scripts and delete them.

Make it better

Increase your ad management skills without spending more time.
Join over 150,000 publishers and AdOpts increasing their ad revenue.