You posting in Blogger (for example: eviltek.blogspot.com) or Blogspot network. Finding way to move WordPress (self-hosting). If you wish to migrate Blogger to WordPress with no lose of website visitor or connect email subscription.
WordPress has two service that is WordPress.org & WordPress.com, and both are different to each other. WordPress.org is a self hosting whereas WordPress.com is much similar to blogger. In WordPress.Org, we have to host website in hosting provider (example: Hostgator). Blogger and WordPress allows importing and exporting of blogs.
But exporting of Blogspot post as well as comment to Blogger losses organic visitor in search engine, as permalink changes. Visitor lands in website through search engine, bookmarks, shared post, email subscription (RSS). Follow below steps to convert Blogger to WordPress (self hosted).
- Before transfer all blog post to WordPress, have a backup of website and article. Book a brand domain name (it is better in .com)
- Launch WordPress.org>download package and install to hosting service. complete necessary steps in WordPress.
- Now Go-to admin page>tools>imports, this option enables to migrate blogger to WordPress (post, comment are transferred to WordPress)
- Open WordPress Theme editor in settings>Appearance option> click on .php file, WordPress uses .php format. either you can upload own theme or else you can add own theme.
- Place below given code in your .php file, save changes after re-designing website.
- <?php
- function labnol_blogger_query_vars_filter( $vars ) {
- $vars[] = "blogger";
- return $vars;
- }
- add_filter('query_vars', 'labnol_blogger_query_vars_filter');
- function labnol_blogger_template_redirect() {
- global $wp_query;
- $blogger = $wp_query->query_vars['blogger'];
- if ( isset ( $blogger ) ) {
- wp_redirect( labnol_get_wordpress_url ( $blogger ) , 301 );
- exit;
- }
- }
- add_action( 'template_redirect', 'labnol_blogger_template_redirect' );
- function labnol_get_wordpress_url($blogger_slug) {
- global $wpdb;
- if ( preg_match('@^(?:https?://)?([^/]+)(.*)@i', $blogger_slug, $matches) ) {
- $q = "SELECT guid FROM $wpdb->posts LEFT JOIN $wpdb->postmeta
- ON ($wpdb->posts.ID = $wpdb->postmeta.post_id)
- WHERE $wpdb->postmeta.meta_key='blogger_permalink'
- AND $wpdb->postmeta.meta_value='$matches[2]'";
- $wp_url = $wpdb->get_var($q);
- }
- return $wp_url ? $wp_url : home_url();
- }
- ?>
- Sign-in to Blogspot or Blogger, Under template> select revert to classic which converts XML-based to Tag based templates
- Paste following code in template editor before doing any changes to WordPress URL. Replace example.com with your website domain name. save changes you done!
- <html>
- <head>
- <title><$BlogPageTitle$></title>
- <script>
- <MainOrArchivePage>
- window.location.href='http://example.com/'
- </MainOrArchivePage>
- <Blogger> <ItemPage>
- window.location.href='http://example.com/?q=<$BlogItemPermalinkURL$>'
- </ItemPage> </Blogger>
- </script>
- <MainPage>
- <link rel="canonical" href="http://example.com/" />
- </MainPage>
- <Blogger><ItemPage>
- <link rel="canonical" href="http://labnol.org/?blogger=<$BlogItemPermalinkURL$>" />
- </ItemPage></Blogger>
- </head>
- <body>
- <MainOrArchivePage>
- <h1><a href="http://example.com"><$BlogTitle$></a></h1>
- </MainOrArchivePage>
- <Blogger><ItemPage>
- <h1>
- <a href="http://example.com/?blogger=<$BlogItemPermalinkURL$>">
- <$BlogItemTitle$>
- </a>
- </h1>
- <$BlogItemBody$>
- </ItemPage></Blogger>
- </body>
- </html>
By completing above steps, we are almost done, now opening any blogger page must redirect to WordPress page. As 301 re-directing, transferring Blogger to WordPress doesn't cause any changes in page rank. Above tricks also works in Blogspot.co.uk as well as Blogspot.in domain name. This Blogger Imports tools migrates posts and comment only, but not images. Images works fine as image URL is migrated from Blogger.
No comments:
Post a Comment