Have you ever setup a WordPress site without the leading www…or with the leading www…and now you want to change it. It is easier than you think. Here are some steps that should work for you (they did for me):
- Start by logging in to the cPanel of server that is hosting your site.
- Click on phpMyAdmin
- Click your database in the left pane. Several tables appear below it. Click on your wp_options table
- Locate the ‘siteurl’ and ‘home’ rows. Click the pencil icon next to each to edit.
- Click the pencil icon next to each to edit.
- Alter the URL by typing in a new one.
- Click the Go button to save the settings. Do this for both the ‘siteurl’ and ‘home’ options.
You should now be able to log into your site at example.com/wp-login.php.
Although this gives you access to your site, any former URLs in your database are still using the old URL. You should now use a plugin to update all URLs in your database to the new URL.
View the following article for full instructions: Changing all URLs in your WordPress database