In essence you’re looking at a re-build, which sounds scary, and does require some thought, but is really just a series of steps, and worthwhile since you seem to have files in the wrong place and a database that might be pointing to some of thee, so it’s not a quick fix. So make a cup of coffee and read on…
Loads of possible ways to attack this, but presuming you’re not heavily into code… given the above, I’d look to build a replica in a test area, and then move this back to live.
Roughly speaking a WordPress installation consists of :
1. Files viz
1a. The core software
1b. Themes
1c. plugins
1d.Uploads
2. The database
So first I’d see if you host provider lets you create sub domains – if so, create one.
Into that install wordpress, that the core software 1a taken care of !
Part of that install will have created a new database, so that will be clean.
Then upload your theme (1b taken care of), and set any parameters needed – Given that you will still have the live system, then you can have the old live in one screen and the new live candidate in another and just fill in by looking at the old one.
Then install any plugins – and yes, whilst there are other ways to do this that could save you doing it, given that you are not sure of the state of everything, I’d set each plugin up again. As per above, you have the live system to copy from. That’s 1c taken care of.
Uploads – If your uploaded images are in one sensible place, then I’d just copy this folder over. If all over the place, then you could consider re-uploading them, your call !
Then finally you need to move the content over. Use WordPress export/import to do this for you, it’ll pull across most if not all of the stuff. Anything missing, you can do manually but it shouldn’t be much !
Then test and make sure all is working, and you have a live site- it’s just as a sub-domain.
Then back all this up !! – files and database!
From here you can do several things I suspect, but the way I’d do it is to
Back the live site up – files and database
Then I’d look at the wpconfig file on the live site, and copy the database settings, or know what they are.
Then there are several routes you could take, and someone cleverer than me might suggest something else.
However I’d copy across the sub domain files to the old site, a chunk at a time, and ensuring that any spurious directories on the live site are deleted.
The alter the wp-config file to point at the live database
That gives you all the files, but the wrong database (ie the new live files are pointing at the subdomain database)
So I’d copy using phpmyadmin the database from the subdomain to the live domain.
Then you’ll need to change the database to have the live url in it
in MySQL within phpmyadmin type the following
UPDATE wp_options SET option_value = 'https://domain.com' WHERE option_name IN ('siteurl', 'home')
where domain.com is your love domain.
You should now have a live site without the rubbish.