Google popup Ads randomly show on two of our websites which are hosted with same hosting provider and possible on same server as its shared hosting. We dont use and kind of ads on our websites

Ads randomly show on some page of website and not always and after checking i noticed following unwanted code on each rendered page where ad show

<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-325xxxxxxxxxxx" crossorigin="anonymous"></script>

I am not a PHP guy but this seem to have infected couple of our website. Websites which are infect are WordPress website as well as PHP (non WP) based websites

Is this due to Malvertising. It seems hosting server has been compromised as ads show on WordPress and non WordPress based website also

  • When you say that you don't use those kinds of ads, do you mean that you don't use AdSense at all, or that you have AdSense configured not to show popup ads? Jul 28, 2022 at 8:59
  • @StephenOstermiller, Yes We don't use any AdSense at all. Its business website not configured for any types of ads. Some Malware or server compromise seems to be injecting Ad code in some pages which show popup based ads randomly..
    – Learning
    Jul 28, 2022 at 10:31
  • This is either malware or your provider inserting content to profit from it. I'd dump any databases and then search the php and databases for "googlesyndication" and see if there is anything there. Its nowhere near fullproof though as if it is malware it can be hidden a few ways. I'd also grep for "eval" statements and base_64_decode statements which are often used to obfuscate code, but again, not fullproof.
    – davidgo
    Jul 29, 2022 at 6:56
  • Relatedly, where are the ads being inserted? Is it always at the top or bottom of the page, or something easily predictable?
    – davidgo
    Jul 29, 2022 at 6:56
  • @davidgo, As mentioned ads show as popup ads in center
    – Learning
    Aug 2, 2022 at 11:39


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.