How To Migrate Your Site From Blogger To WordPress

Moving towards wordpress is a really great idea for all bloggers who are still using blogspot free site. There are a lot of beneficial features in wordpress hosting. Only you have to find out a better wordpress hosting company. Firstly, You have to buy a domain and web hosting service with one- click wordpress installation. After this, Install wordpress on your new domain. Now follow the easy steps to migration.

blogger

STEPS TO EXPORT YOUR BLOGGER CONTENT:

  1. Go to your blogger dashboard
  2. Click on Settings > Others 
  3. Click on Export Blog          

4. A pop up will come, Click the Download button

Screenshot (8)

5. Now save this XML file format.

STEPS TO IMPORT YOUR BLOGGER CONTENT IN WORDPRESS:

1. Go to your wordpress dashboard

2. Go to the Tools > Import button > blogger

Screenshot (11)

3. Install the blogger importer plug-in and upload your XML file here. 

IMPORTANT CHANGES IN PERMALINKS:

1. Go to your wordpress Dashboard > Settings > Permalinks

Screenshot (12)

2. Choose common settings into Name And Month    

SETTINGS TO MAKE REDIRECTION FOR SEARCH ENGINE OPTIMIZATION:

1. Go to the blogger dashboard

2. Click on the templates option

3. Click on Revert to classic templates

4. Now you will see a HTML editing area, Change the codes with given following codes. Keep remember that change your http://example.com with your own website name.

01 <html>
02  <head>
03   <title><$BlogPageTitle$></title>
04
05    <script>
06     <MainOrArchivePage>
07     window.location.href="http://example.com/"
08     </MainOrArchivePage>
09     <Blogger>
10      <ItemPage>
11      window.location.href="http://example.com/?blogger=<$BlogItemPermalinkURL$>"
12      </ItemPage>
13     </Blogger>
14    </script>
15
16    <MainPage>
17    <link rel="canonical" href="http://example.com/" />
18    </MainPage>
19
20    <Blogger>
21     <ItemPage>
22     <link rel="canonical" href="http://example.com/?blogger=<$BlogItemPermalinkURL$>" />
23     </ItemPage>
24    </Blogger>
25  </head>
26
27  <body>
28   <MainOrArchivePage>
29    <h1><a href="http://example.com/"><$BlogTitle$></a></h1>
30   </MainOrArchivePage>
31   <Blogger>
32    <ItemPage>
33     <h1><a href="http://example.com/?blogger=<$BlogItemPermalinkURL$>"><$BlogItemTitle$></a></h1>
34     <$BlogItemBody$>
35    </ItemPage>
36   </Blogger>
37  </body>
38 </html>

 

Now Save Your Template And You Have Done Half Of Redirection Process

5. Now Go to your wordpress Appearances option

6. Click on Editor > Find out Functions.php file in right side bar

7. In the Functions.php file, You will have to copy and paste the following code.                     

01 function blogger_query_vars_filter( $vars ) {
02   $vars[] = "blogger";
03   return $vars;
04 }
05  
06 add_filter('query_vars', 'blogger_query_vars_filter');
07  
08 function blogger_template_redirect() {
09   global $wp_query;
10   $blogger = $wp_query->query_vars['blogger'];
11   if ( isset ( $blogger ) ) {
12     wp_redirect( get_wordpress_url ( $blogger ) , 301 );
13     exit;
14   }
15 }
16  
17 add_action( 'template_redirect', 'blogger_template_redirect' );
18  
19 function get_wordpress_url($blogger) {
20   if ( preg_match('@^(?:https?://)?([^/]+)(.*)@i', $blogger,$url_parts) ) {
21     $query = new WP_Query (
22       array ( "meta_key" => "blogger_permalink", "meta_value" =>$url_parts[2] ) );
23     if ($query->have_posts()) {
24       $query->the_post();
25       $url = get_permalink();
26     }
27     wp_reset_postdata();
28   }
29   return $url ? $url : home_url();
30 }

 

NOW YOU HAVE ALL DONE 🙂 It is the 301 redirection of yoyr site for best SEO results. Now If anyone would visit your blogspot site. They would directly go to your wordpress blog. But If someone open your site on mobile phone, this will not work. So, Follow only a few more steps and your smartphone visiters will also redirect to your new site.

1. Go to the blogger dashboard

2. Now click on Templates Settings

3. Choose Here ‘No, show desktop templates on mobile devices’.

4. Go to Appearance > editor > .htaccess file and replace the codes with given codes below :       

# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteEngine On
RewriteCond %{QUERY_STRING} ^m=1$
RewriteRule ^(.*)$ /$1? [R=301,L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress


# Begin Redirection
#Redirect archives
RewriteRule ^([0-9]{4})_([0-9]{1,2})_([0-9]{1,2})_archive.html$ $1/$2/ [L,R=301]
#Redirect labels/categories
RewriteRule ^search/label/(.*)$ category/$1/ [L,R=301]
RewriteEngine On
RewriteCond %{QUERY_STRING} ^m=1$
RewriteRule ^(.*)$ /$1? [R=301,L]
#ATOM Feeds
RewriteRule atom.xml feed/atom/ [L,R=301]
RewriteRule feeds/posts/default feed/atom/ [L,R=301]
#RSS FEEDS
RewriteRule feeds/posts/default?alt=rss feed/ [L,R=301]
RewriteRule rss.xml feed/ [L,R=301]
#Comments Feed
RewriteRule /feeds/comments/default comments/feed/ [L,R=301]
RewriteRule /feeds/comments/default?alt=rss comments/feed/ [L,R=301]
# End Redirection

After completing this process carefully. You are done with migrating from blogger to wordpress with 301 redirection. If you have any queries feel free to ask. 🙂

 

                                           

 

 

Web Hosting

Leave a Reply