How to Remove/Disable/Hide ?m=1 and ?m=0 on Blogger Using JavaScript (100% Working)

For you Blogger Custom Domain users, you should already know that Blogger provides a certain code structure that will be displayed on the mobile page version by adding? M = 1 and? M = 0.



Well, in this article the author will provide an article entitled How to Eliminate the Code? M = 1 and? M = 0 at the end of the Blog URL. Do you know why these codes must be removed? If you don't know, the writer will provide the information. After completing this tutorial you can remove the ?m=1 on your blog.

height="250"
layout="responsive" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzmvJTEAfCMK6cmVVNAFvBR8GEgr3KNFV3k3HsH5-3AVyotJ3ZAL-sElv37idCgFItWVfmYXGHvhKZgaypYFqU6H3p67_mOsDuyhy5E6oUcZXBBwAjBt23nsw3JGDdp9dh7gab2D5vleI/s1600/Remove+m%253D1+and+m%253D0+on+blogger.jpg">




Before going tutorial some are don't know why we remove ?m=1 tag in blog. Because, on search error. The search console have showing on error duplicate content found before paste the code u will get this error but after you paste the code you will be never get any duplicate content error.



Example :-

https://urlblog.com/?m=1

https://urlblog.con/?m=0



In anyone view the URL from above the above two are same. But, in search engines are identify that's was duplicate or same content two URL. Why see the M tag after blog because that was an mobile view.



The meanings of the two codes are as follows;



?m=1: Code that indicates that the blog or website is being accessed in cellular / mobile mode

?m=0: Code that indicates that the Blog or Website is being accessed in Desktop mode on a mobile device.



How to remove ?m=1 or ?m=1 on your Blog

copy the below code and paste anywhere on template.



<script type='text/javascript'>
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>


There will be two method for adding the script on template. one is HTML widget another one is paste the code above </head>

Comments