I have a shared hosting and some wordpress websites on that. Recently sometimes when I visit my websites, popup opens. So I opened template directory of one wordpress website in
No need to do ton of such changes, simply do these two steps >>
1 > Dashboard > Updates > "Re-install Now"
This will re-install latest version of WordPress, overwriting infected wp core files.
2 > Now open theme functions.php file in editor and remove malicious code snippet and hit save.
All done! this time it will accept the file changes to remove infected code from functions.php file.