THE BEST ALTERNATE WAY TO CHANGE ?m=1 FROM THE END OF ANY BLOGGER.COM URL

THE BEST ALTERNATE WAY TO CHANGE ?m=1 FROM THE END OF ANY BLOGGER.COM URL

 ?m=1 in CSS terms is called Media Only and Screen which indicates that the URL is being accessed using a mobile device. The purpose of removing the Blogger ?m=1 URL is to reduce the duplication factor of detected content.


In short, if you want to remove the URL ?m=1, you can use one of the following methods:

Through the Layout Menu

  • Go to the Layout menu
  • Then add a widget/gadget and select HTML/Javascript
  • Copy the following code:
    <script type=&
    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>
  • Enter the following code into the widget/gadget
  • then press the Save button
  • Done

Through the Theme Menu

  • Go to the Themes menu.
  • Then press the Edit HTML button.
  • Look for the </head> code and copy the following code right above it:
    &lt;script type=&
    var uri = window.location.toString();
    if (uri.indexOf(&quot;&amp;m=1&quot;,&quot;&amp;m=1&quot;) &gt; 0) {
    var clean_uri = uri.substring(0, uri.indexOf(&quot;&amp;m=1&quot;));
    window.history.replaceState({}, document.title, clean_uri);
    }
    var uri = window.location.toString();
    if (uri.indexOf(&quot;?m=1&quot;,&quot;?m=1&quot;) &gt; 0) {
    var clean_uri = uri.substring(0, uri.indexOf(&quot;?m=1&quot;));
    window.history.replaceState({}, document.title, clean_uri);
    }
    &lt;/script&gt;
  • Then press the Save button
  • Done

Remember, just use one (1) method above. Until now, you have successfully removed the URL ?m=1 on your blog when using a mobile device