Instead of delete, you can move all files from /wp
to root
folder.
Then use this script to replace url from example.com/wp
to example.com
inside the database https://interconnectit.com/products/search-and-replace-for-wordpress-databases/
Follow these few steps.
- Move all your website files to root from
/wp
folder. - Upload the script folder to your web root.
- Browse to the script file URL in your web browser. eg. http://example.com/Search-Replace-DB/
- Fill in the fields as needed.
- Hit on run button
It will replace all your old string to your new string inside the database.