How to remove ?m=1 from the Blogger URL (2021)

 How to remove ?m=1 from the Blogger URL:-

Want to remove ?m=1 from your Blogger URL. So read this post till the end because I will share today How to remove ?m=1 from the Blogger URL. 
When you visit your website on mobile and see this ?m=1 at the end of your website URL and want to delete this. So don't get confused because today in this post I will discuss this. 
Guyz  ?m=1 is a mobile view parameter but in the Google Webmaster tool its shows an error of alternate page with canonical tags.

How to remove ?m=1 from the Blogger URL




So to remove ?m=1 follow these simple steps:-

How to remove ?m=1 from the Blogger URL:-

  • Go to Blogger.
  • Go to Theme.
  • Click on Edit HTML.
  • Press Ctrl + f for search.
  • Find </body> tag.
  • Paste that code above </body> tags.
<script type='text/javascript'>
//<![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>
 
Copy this code and paste it above the </body> tags. After pasting the code click on the save theme button. Your issue solved and ?m=1 is removed from your URL.

Read also:-

I hope this post will be helpful to you. If you have any queries, please comment and share this post.

Post a Comment

3 Comments