Remove ?m=1 From Ending URL In Blogger

 



 

Blogger.com is one of the best blogging platform available to publish your blog online. If you are using blogger to publish your blog , one thing you must have noticed that whenever you open your blog on mobile device , its url is always ending with ?m=1

It does not matter that whether you are using blogger's official subdomain [ yoursite.blogspot.com] or own custom domain , ?m=1 is always ending on both type of domain.

How To Exclude ?m=1 From Blogger

Removing ?m=1 from blogger is very easy , just you need to add a specific javascript code, which will remove ?m=1 from ending url of your blog.

Steps:
  • Open Blogger.com , Choose Your Blog 
  • Go To Theme And Choose Edit HTML From Drop Down Option

  • Now Before Ending of Body Tag , Paste The Following Code :
<script type='text/javascript'>
<!-- Code From narendradwivedi.org -->
//<![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);
}
//]]>
</script>



  • Done. Save The Code. Now ?m=1 will be excluded whenever you open your blog on mobile device