Go to Settings > General and change the URL for both the WordPress Address and Site Address to use the main domain name. Be sure to remove the trailing / . Click Save Changes.
Using File Manager, you will need to MOVE all of the WordPress files from the subdomain’s folder up one level to the public_html or Addon domain root folder.
- Double click the subdirectory containing the WordPress files to expand it open.
- Click Select All to select all the files and folders.
- Click the Move File icon.
- In the Move dialog box, remove the subdirectory from the path field, so the path you are moving to is /public_html or Addon domain folder
- Click Move Files.
The files should now be moved to the public_html / Addon domain folder.
Login to WordPress in the root directory which should be your domain name plus /wp-admin, e.g. http://mywebsite.com/wp-admin.
Go to Settings > Permalinks and click Save Changes. This will rewrite the .htaccess file that controls the “pretty” URLs on the site. This likely isn’t going to be an issue when you are using a subdomain install, as the .htaccess contents should be correct.
Install the Velvet Blues Update URLs plugin.
Under Tools > Update URLs, type the subdomain website address in the Old URL field and the main website address in the New URL field.
Be sure to not end the URLs with a forward slash /. If you do end it with a forward slash, end it with a forward slash for both URLs not just one. Consistency is important here.
Be sure to NOT not update all GUIDs. This will result in many theme settings to reset and posts to republish to the RSS feed.
Click the Update URLs button. This should catch most of the URLs on the site. However, if it seems to miss several, you can try repeating this process without the http:// part of the URL, and see if it catches more.
Check for other URLs not caught with the Velvet Blues plugin including:
- Appearance > Menus — check for any custom URLs to the old site URL in any custom menu items, such as the home page link.
- Appearance > Theme Options or your theme’s Theme Options page — check the URLs for any uploaded files such as the logo or favicon and remove the subdirectory from the URLs as needed.
- Sliders — If you use Revolution Slider or other slider plugin may not update the URLs to the slider images with the Velvet Blues plugin. Edit the slider and remove the subdirectory from any image URLs.
- Shortcodes and custom layouts — Some shortcodes for button links or custom theme layouts may contain URLs to the subdirectory which you may need to manually change. If you can find a pattern to these, you can try to run the Velvet Blues plugin again using the URL pattern you find.
Test the site and be sure everything is appearing as expected. If anything is amiss, be sure to clear your browser cache completely or test in a browser you don’t usually use.