Keep the Traffic After Moving from Blogger to Self-Hosted WordPress

Published on 20 November 2022
Redirects Custom Domain Blogger Sites to Self-Hosted WordPress

Blogger is one of the starting points for some people to begin their blogging journey. It is free and easy to setup. With Blogger, you can get a blog with a custom domain in just few minutes. However, as you and your blog are growing, you may start to feel some limitations and decide to move it to other CMS platform.

I have started many blogs on Blogger too. As the time goes by, the traffic to those websites increased and I got the urge to take more control over the SEO.

Over the years, I've tried several CMS platforms, i.e. Anchor CMS, Bolt, Chyrp, CMS Made Simple, Contao, Drupal, GetSimple CMS, Ghost, Joomla, LiteCart, Magento, Opencart, Pico, SilverStripe, Tiki Wiki CMS Groupware, Typo3, Wolf CMS, and WordPress. Most of the time, I choose WordPress because it's versatile, pretty lightweight on shared hosting, and has massive community support.

I have imported blog data from Blogger to self-hosted WordPress. Now what?

The most important thing to do to keep the traffic after moving your custom domain Blogger site to another platform is to make sure every URL is still working.

Blogger has its own URL patterns or structures that do not match with the WordPress' default URL patterns. Unmatched links can direct visitors to 404 page which can make them lose the desire to explore the site further. The solution would be either change the WordPress' permalinks setting to follow the old URL patterns from Blogger or redirect the old links from Blogger to follow the new URL patterns from WordPress. I prefer the later solution because WordPress' URL structures are more SEO-friendly.

URL Redirections

These are the codes that I use to redirect old links when I migrate my custom domain sites on Blogger to self-hosted WordPress.

Redirect Blogger’s Mobile Version Pages Using .htaccess

Users can have Blogger to serve mobile version of their sites when visitors open it on mobile devices. The mobile version is characterized by query string ?m=1 that is added automatically at the end of the URLs, e.g Visitors can force open the web version by changing the number to 0, i.e. ?m=0.

If you don't plan to use the same approach to serve mobile version of your new WordPress site and instead want to use responsive design approach with single URL for both mobile and web version, you should redirect those strings to non-strings (remove the query strings ?m=1 and ?m=0 from URLs) by adding this code to the .htaccess file in your site's root directory:

RewriteEngine On
RewriteCond %{QUERY_STRING} ^m=.*$
RewriteRule ^(.*)$ /$1? [R=301,L,QSD]

Redirect Pages

Blogger pages have URL structure of /p/page-name.html, while WordPress pages only use the page-name, so you have to drop the /p/ and .html.

Add the code below to your root directory's .htaccess file to redirect all pages to their new URL structures, such as from to

RedirectMatch 301 ^/p/(.*)\.html$ /$1

If you only want to redirect a single page, you can use this code:

Redirect 301 /p/page-name.html

Redirect Posts

Blogger posts have URL structure of /year/month/post-name.html. If you prefer to keep the same structure, you can set your WordPress posts' permalinks to have the same structure. This is how to set WordPress posts to have the same URL structure as Blogger's:

  1. Go to 'Settings' > 'Permalinks'
  2. In the 'Common Settings', choose 'Custom Structure'
  3. Then, input /%year%/%monthnum%/%postname%.html
  4. Click 'Save Changes' button

If you want to remove the year, month, and .html extension from your old Blogger URLs, add this code to your root directory's .htaccess file:

RedirectMatch 301 ^/([0-9]+)/([0-9]+)/(.*)\.html$ /$3

Redirects Label Pages

In WordPress, you can group posts using 'Categories' and 'Tags'. In Blogger, there is only one grouping type, i.e. 'Label' that has URL structure of /search/label/Label%20Name.

If you only have several Label pages, you can redirect the pages one by one to a category page using this code:

RedirectMatch 301 ^/search/label/Label.*Name.*$

or, redirect it to a tag page:

RedirectMatch 301 ^/search/label/Label.*Name.*$

However, if you have a lot of Label pages that don't have specific name patterns, it can be tiresome to redirect the page one by one. In that case, I would just leave the Label URLs as it is without redirecting it to anywhere. You don't have to worry about it because WordPress will treat it as a search query. If you follow the Label pages' URLs on your WordPress sites, it will turn to search result pages. For example, visiting will bring you to a search result page for keyword 'label/My Kitchen'.

Update Links

Bulk Remove Date from Internal Links Using phpMyAdmin Search and Replace Regex

If you like to do internal linking on your Blogger site, you may have links in the posts' contents or in the comment sections that still have the Blogger posts' URL structure. While it's okay to just keep it that way as they will be redirected to the new URLs by the rules we have set in the .htaccess, I prefer to update those internal links to follow the new URL structure.

Basically, we will search all URLs that still have year, month, and .html extension and then remove the year, month, and .html from those URLs. If you use cPanel hosting, you can utilize phpMyAdmin's Find and replace function.

  1. To replace the internal links in post contents, go to 'wp_posts' table.
  2. Navigate to 'Search' tab > 'Find and replace'
    • In the 'Find' field, input: https://www.yoursite\.com/([0-9]+)/([0-9]+)/(.*)\.html
    • In the 'Replace with' field, input:$3
    • In the 'Column' field, choose 'post_content'
    • Check the 'Use regular expression'
    • Click 'Go' button
    • Review the search result, then click 'Replace' button
  3. To replace the internal links in comments, go to 'wp_comments' table.
  4. Navigate to 'Search' tab > 'Find and replace'
    • In the 'Find' field, input: https://www.yoursite\.com/([0-9]+)/([0-9]+)/(.*)\.html
    • In the 'Replace with' field, input:$3
    • In the 'Column' field, choose 'comment_content'
    • Check the 'Use regular expression'
    • Click 'Go' button
    • Review the search result, then click 'Replace' button

Do you have any problems or additional tips? Feel free to share it in the comment below.

First published by  on .

Add A Comment

Your email address will not be published. Required fields are marked *