Guys, I guess I cleaned the site back on 11th of April. I don't know how I did it. But these are the steps I took:
1) Downloaded all the database and site, deleted everything I felt suspicious.
2) while cleaning database, I backed up database sections separately one by one. E.g. If I'm to clean wp options, I backed up it first.
3) I cleaned uploads directory.
4i restored the the site and scanned again with most of the makware plugins.
5) I noticed that after reinstalling rank math seo, 404 urls started coming back. It didn't make any sense at first. Then I thought it might have been due to the rank math generated site maps, wasn't sure though. Than I deleted the rank math plugin again, and cleaned each rank math related line in the database. Cleaned rank math existence on the uploads folder.
6) reinstalled rank math.
7) Long time ago I had updated WordPress ping post urls. And I thought checking them might be useful. There were pinging urls in the list ending with .php, I deleted all those urls. Not sure if they were dangerous or not.
>The result; rank math stopped generating 404s.
> the problem which still persists is, google search console hasn't deindexed those spam links. But the last generated spam link date is 11th of April.
How can I clean those links? Can someone show me a way?
Thank you.