WordPress how to change domains?

There are a few steps that you will need to take to go ahead and get the domain changed.

How to change your domain name?

    * Connect to your account using FileZilla
    * Go into your active themes directory normally in /wp-content/themes/
    * Download the functions.php file (for your active theme)
    * Open it using a simple text editor such as notepad
    * immediately after the initial "<?php" line, add the following:

          update_option('siteurl','http://example.com/blog');
          update_option('home','http://example.com/blog');

    * Use your own URL instead of example.com, obviously.

    * Save and re-upload the functions.php file, overwriting the original that is there.
    * Go to your admin page, and hit "F5" a couple of times, your new site should come up.

    * Please note, that if there isn't a functions.php file in your themes directory, just create a file called "functions.php" and place it in there. The code that would need to be entered into that file would be:
    <?php
    update_option('siteurl','http://example.com/blog');
    update_option('home','http://example.com/blog');
    ?>

Now, almost done…

    * After you login, click on "Settings"
    * Now, click on "General"
    * Modify both of the below settings:

          Blog address (URL)
          WordPress address (URL)

    * Upon completion, click "Save Changes"
    * Upon completion of the above, just undo the functions.php changes that you did, because now you have set the correct url in the database, you should be fine going forward.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How do I modify the inbox size within cPanel?

When you successfully create mail account in cPanel, the default quota will be assigned to the...

How do I block an IP address using cPanel?

If you want to prevent an IP address or a whole range of IP addresses from accessing your site,...

After suspension, my databases are not working

If you are getting the following message; "Error establishing a database connection", this is a...

Does my hosting account have a file count (inode) limit?

All hosting accounts / providers have some sort of file count limit. The file count limit to...

How do I obtain Raw Access Logs?

Raw Access Logs are logs that are going to give you the most information about your sites...