Well I thought it was time to change domain names hosting my blog WordPress site.
Hello from davidhill.co and goodbye virtual-blog.com
So why did I make this decision? I certainly haven’t taken it lightly. Moving Domain Names is challenging and requires a lot of thought and pre-planning. However, I wanted to have a blog site that was more relevant to me personally, rather than just purely virtualisation. My old domain name just didn’t fully reflect the content anymore. I was able to purchase davidhill.co when they released the .co domains with the intention of switching. Now I have finally bitten the bullet and gone ahead with the migration.
WordPress Change Domain Names
So what steps did I take?
Well first off, I bought the domain name (yeah duh!!)
Secondly I spent a number of hours researching what I had to do to manage my SEO. This is a really good link that can help you understand what is needed: https://support.google.com/webmasters/answer/83106?hl=en
Once I investigated and realised I had to setup 301 redirects from my old site, to the new site, I decided to use the plugin Simple 301 Redirects.
Export permalinks to CSV file
Now one of the challenges I had was to redirect every URL on my site… Hmmm, please tell me I dont have to do this manually… A quick google brought me to this site, which has some nice PHP code that allows you to export every permalink URL on your site. Pretty cool!
I modified the code to just export the URLs and nothing more. I have included the code I used on my site. Simply paste into a text file, and save as export.php in the root of your website.
<!--?php include "wp-load.php"; $posts = new WP_Query('post_type=any&posts_per_page=-1&post_status=publish'); $posts = $posts--->posts;
/*
global $wpdb;
$posts = $wpdb->get_results("
SELECT ID,post_type,post_title
FROM {$wpdb->posts}
WHERE post_status<>'auto-draft' AND post_type NOT IN ('revision','nav_menu_item')
");
*/
header('Content-type:text/plain');
foreach($posts as $post) {
switch ($post->post_type) {
case 'revision':
case 'nav_menu_item':
break;
case 'page':
$permalink = get_page_link($post->ID);
break;
case 'post':
$permalink = get_permalink($post->ID);
break;
case 'attachment':
$permalink = get_attachment_link($post->ID);
break;
default:
$permalink = get_post_permalink($post->ID);
break;
}
echo "t{$permalink}";
}
Simply save as a text file and import into excel. Then install the 301 Redirect Bulk Uploader and create a CSV file and do a bulk upload.
Once you have the 301 redirects in place, its time to hit google webmaster tools and complete the change of address. You need to have the old site up and running to have the redirects in place for at least 180 days.
One final step is to start contacting all the web administrators who link to my site, and ask them to change the URL.
Thats it so far, if anything else occurs I will update this page accordingly.
No comments yet.