Wow, that looks like pain. I would suggest to:
- create backup of your site here using cloudways console
- download official and latest version of WordPress
- access site through FTP and delete completely folder: WP ADMIN with all inside, also delete all from WP includes. Don’t touch WP content folder! Delete all files sitting outside those folders except wp-config.php
- unzip WordPress files and copy to your public folder: WP ADMIN and WP INCLUDES folders plus files sitting outside those folders.
- Go to website ,load it, see if issue is still there.
- if it is still there, you very likely have installed plugin which is causing this. See if there is any suspicious plugin you never installed. Delete plugins one by one. Download them from official sources and install again.
Make sure to copy setting for some plugins so you don’t lose some important customization.
If you have no idea what im saying here just open ticket on cloudways support and get guys to do that all for you. Also get them to scan your public folder. Maybe they will be able to find out infected files and fix all without painful process of re-install and testing.
If your site is just in development mode, you don’t have nothing important there the easiest to sort this would be to just copy your content, delete all and start form scratch.