i had this malware attack. which inserted google ads code in my home page and whenever user browse through mobile or desktop they could not click my buttons but the ad opens, Checking the source code clearly shows the google ads code but i dont know the location of the file which i can open and delete the code. and yes i have secured my site and changed the passwords. magento 1.7 yes its outdated.

code is this

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

(adsbygoogle = window.adsbygoogle || []).push({});
  • do you have a development copy of the site? If so go to system>configuration>advanced>developer> debug. Change the current scope to that of the website with the problem and then enable Template Path Hints and reload the site. It will show which template file each bit of the page is coming from. Don't do this on a live site though... it will be covered in red bits that your customers will see.
    – jscar
    Commented Mar 5, 2020 at 8:14
  • Several times this malicious code is injected inside CMS blocks or CMS pages, so my suggestion is to check inside them or in System->Configuration->General->Design in HTML Head section in various scripts field Commented Mar 5, 2020 at 8:53
  • Thank you very much it helped alot. it was present in the footer links. deleted it and now its over. Commented Mar 5, 2020 at 9:08


Your Answer

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

Browse other questions tagged or ask your own question.