Header Ads Widget

 


Why Blogger shows ?m=1 in Mobile URLs ?

Blogger is quite outdated now.As you know Blogger shows ?m=1 in URL when someone visits the site from Mobile devices and earlier most of the Blogger themes doesn’t use the responsive design. Most themes show different versions for Desktop and mobile users.

It looks a little odd and most of the users don’t like this. Removing the ?m=1 from the mobile URL gives your website a professional look and you can try this on your website.

So, In this article, I will show you how you can Delete the ?m=1 URL parameter from your Blogger website. I will also tell you should you implement this on your website or not.

https://www.yashita.com.np/?m=1

Currently, there is no permanent fix to this problem, but you can display a clean URL to the visitors when they land on your website through a mobile device.

Here, you need to use a script that does the job for you. So, let’s check how you can fix the ?m=1 problem on the Blogger website.

How to remove ?m=1 from Blogger

To remove the ?m=1 from Blogger URL, follow the below steps.

Step-1: Go to Blogger dashboard and select the theme option

Step-2: Now click on the “Edit HTML” option from the drop-down menu.

Step-3: Now you have to add the below script just below the <head> tag.

<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>

Step-4: Now save the code and the ?m=1 will be removed from the blogger website for mobile devices.

If the above code is not working well then you can use the below code to remove the ?m=1 from the Blogger URL in Mobile.

<script>/*<![CDATA[*/ 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>

Now the biggest question is should you remove them ?m=1 from your Blogger website using a script or not?

Does it improve the speed of Blogger?

Using this script doesn’t remove the ?m=1 from the blogger URL permanently. Instead, it again redirects this URL to the original URL in the user’s Browser.

So, if you want a clean URL then you can use it just below the <head> tag of your theme file.

 

Post a Comment

Previous Post Next Post