Days
Hours
Minutes
Seconds

New Year Sale is here!
40% off on Everything for a very limited time

Claim The Offer Now

How to disable ads from WordPress search results

One of WP QUADS default settings is to disable ads on WordPress search result pages.Usually on such kind of pages there is not enough unique content to serve ads compliant to google AdSense policy. If you are using other ad vendors or you just want to overwrite this behavior for any other reason you can use the following method:

Copy the following code into the functions.php of your WordPress theme:

function prefix_show_ads_on_search_page($showads){
if (is_search()){
$showads = true;
}
return $showads;
}
add_filter('quads_show_ads','prefix_show_ads_on_search_page');

You can adapt this snippet to overwrite other ad visibility conditions as well:

  • is_feed()
  • is_search()
  • is_404()

Follow the steps to add the code in Fucntion.PHP file:

Step 1: Copy the code from documentation and change the snippet as per you need.

Steps 2: Paste the code in function.php file as per the below screenshots

That’s it for this tutorial!

We hope it helped you. If you have any feedback or questions or do you want us to create compatibility for any other Ad company which isn’t listed in our plugin then you can request us we will surely implement it as soon as possible.

Just contact us here and we are always available for you.

Powered by BetterDocs