24.11.08(pm): How to resolve when the page does not load due to malicious code in jquery.min.js

Since June 24, it has been infected with malicious code and there has been a problem with the page not loading due to the malicious code https://cdn.talk2star.com/jquery.min.js.

It was blocked as an illegal site because there was an overlapping js with the existing jquery.min.js.

When I entered F12 developer mode, I was able to confirm that an error occurred in jquery.min.js as shown below. My homepage is not loading because it moves to an unknown site.


Then, I found an article about someone experiencing a similar problem as me and found a solution. thank you! https://www.cosmosfarm.com/threads/document/69357

To solve this problem, the following function was added to the functions.php file in the theme files.

function remove_unwanted_script() {
    ob_start(function($buffer) {
        $buffer = str_replace('<script src="https://cdn.talk2star.com/jquery.min.js"></script>', '', $buffer);
        return $buffer;
    });
}

I’ve been stressed out for 5 months trying to resolve this issue, but I’m glad it’s finally resolved. I never added this illegal site to the Ads.txt file, but it was also included in this file.

I saw a news report that malware infected 39,000 WordPress sites in April 2024. My homepage must have been one of them, and it has been down since June… The method is similar to the method described in the article.

https://tuxcare.com/blog/wordpress-sign1-malware-infects-over-39k-sites-in-6-months/

Leave a Reply