-2

First off, I'm not a developer, but a site owner running wordpress. my site has some Amazon affiliate URLS. What is happening is some rogue javascript is running and changing the referral ID's of the HTML code only from a google search specifically (If I load a page directly the HTML doesn't change). Basically I'm trying to figure out how to locate it, I figure that by looking at the html section I can trace what javascript is changing the HTML? With that information maybe I can help find it or pass that on to the hosting company to remove the file.

For example: in the website shows : https://amazon.com/49684095/?tag=properamazontag the javascript runs and changes to: https://amazon.com/49684095/?tag=douchebagscammercode

I hope it makes sense.

I have disabled javascript in the browser and confirm that the HTML code doesn't change, so I know it's a javascript issue.

acedd2
  • 7
  • kindly go through [ask]. you should have a basic understanding of the java script to accomplish your expectations here – jaibalaji Nov 15 '22 at 04:58

1 Answers1

0

For anyone looking at this with the same issue, what I did was follow this thread Find javascript that is changing DOM element. I went through all the JS changes looking for odd code not associated with a plugin file or theme.

once I found the code, I used a plugin called string locator and searched "everything under WP-content" for the first part of the bad code. From the plugin shows the location of the code (a JS file was added to the theme template) and I then used the same technique to search for the names JS file (in this case called theme.js) and found a php line in the functions.php file that had to be deleted along with the file.

acedd2
  • 7