Blogger provides two urls. One url is for desktop version and another url is for mobile version. Every blog has those urls in blogspot.co...

How to Redirect ?m=1 in Blogger for Mobile Friendly

redirect

Blogger provides two urls. One url is for desktop version and another url is for mobile version. Every blog has those urls in blogspot.com and custom TLD domain. It is what I mean :

You will see one blog. Let's say someoneblog.blogspot.com or someoneblog.com from godaddy domain seller.

Blog readers don't come only from desktop but also from mobile. If they come from desktop, browser shows that url's blog is 'someoneblog.blogspot.com' or 'someoneblog.com' and If they come from mobile, browser shows that url's blog is 'someoneblog.blogspot.com?m=1' or 'someoneblog.com?m=1'

Yes, there is always '?m=1' in the end of url.

You want to remove it so that browser shows it without ?m=1. It is possible.

Before you remove it, you have to make it sure first that your blog is mobile friendly in all devices.

If it isn't mobile friendy blog, it will bring not-good to your blog since readers can't read your blog properly.

Test your mobile friendy blog in | Mobile Friendly

Let's say that it is already mobile friendly so you can remove ?m=1 if you want to.

Step by step to remove it :

1. Click Theme

2. Click Edit HTML

3. Find the code : </body>

4. Put this code :

<script>
//<![CDATA[
var uri = window.location.toString(); if (uri.indexOf("%3D","%3D") > 0) { var clean_uri = uri.substring(0, uri.indexOf("%3D")); window.history.replaceState({}, document.title, clean_uri);}
var uri = window.location.toString(); if (uri.indexOf("%3D%3D","%3D%3D") > 0) { var clean_uri = uri.substring(0, uri.indexOf("%3D%3D")); window.history.replaceState({}, document.title, clean_uri);}
var uri = window.location.toString(); if (uri.indexOf("&m=1","&m=1") > 0) { var clean_uri = uri.substring(0, uri.indexOf("&m=1")); window.history.replaceState({}, document.title, clean_uri);}
var uri = window.location.toString(); if (uri.indexOf("?m=1","?m=1") > 0) { var clean_uri = uri.substring(0, uri.indexOf("?m=1"));window.history.replaceState({}, document.title, clean_uri);};
var protocol=window.location.protocol.replace(/:/g,''); if(protocol=='http'){ var url=window.location.href.replace('http','https'); window.location.replace(url);}
//]]>
</script>

Above </body> code

5. Click Save Theme and you have done.

Read your blog in mobile device and you will see nothing ?m=1 in the end of url since the script has redirected it from mobile to desktop version.

⇽ Newer Older ⇾