Moving WordPress to new Host and Domain

[toc]

Changing Settings

  • Go to Administration Screen of your wordpress
  • Select Settings and click “General”
  • Change the “WordPress Address(URL)” and “Site Address(URL)” to your new domain

Downloading Files

  • Download all files/folders from your wordpress Directory using any method like
  1. If you have FTP Access to your server then download files using ftp clients like FileZilla
  2. Using cPanel’s FileManager or other FileManger option provided with your Host. Create an archive and download whole directory containing wordpress files

Database Backup

Editing wp-config.php

  • Open wp-config.php in your downloaded wordpress directory with text editor like Notepad++
  • Change the following to new settings of your web-host
/** The name of the database for WordPress */
define('DB_NAME', 'wordpress');

/** MySQL database username */

define('DB_USER', 'root');

/** MySQL database password */

define('DB_PASSWORD', 'root');

/** MySQL hostname */

define('DB_HOST', 'localhost');
  • Save the file

Uploading Files

  • Upload the files to your web-host using FileZilla or
  • Create an Archive and upload using FileManager provided by web-host
  • Extract the files (You can delete the archive after extracting)

Fixing Broken Links

  • After moving your wordpress blog/site you will notice that images,other media or attachments are broken and point to your old URLs
  • Easiest way to fix broken links after moving wordpress is by using Velvet Blues Update URLsPlugin. You just need to enter Old url,New Url and it will automatically fix all the broken links.
  • Another Method to do the same is using Search and Replace Plugin
  • If nothing works you can open the .sql file downloaded after backup and open it with text editor like Notepad++. Now Find and Replace all the  occurrences of Old Url with your new Url .

Remove WordPress meta generator tag from Page Source

WordPress default installation adds meta generator tags to page source showing wordpress version like

<meta name=”generator” content=”WordPress 3.2.1″ />

You can remove the tags and also recommended due to safety reasons

Steps:

  • Login to Dashboard
  • Go to Appearance>Editor  on left sidebar of Dashboard
  • Now Select functions.php and add following code at the end (before ?> )
remove_action('wp_head', 'wp_generator');
  • Click “Update File” to save (Tags will now be removed)

If functions.php does not exist in your theme then make a file named functions.php and add following in the file

<?php
remove_action('wp_head', 'wp_generator');
?>

There are also some plugins available which remove the tags and make things easy for you like Remove Meta Generator Tag