How To Remove "?m=1" From Blogger URL

How To Remove "?m=1" From Blogger URL

It's a well-known fact that simplicity is beautiful. In this post, I will explain how to remove "?m=1" from blogger's URL and create a simple, professional one. When you visit any Blogger blog on the mobile phone, you will see "?m=1" in the page address (URL). This parameter is usually associated with a mobile view.

Many bloggers have asked questions about "how to remove "?m=1" from blogger" around the web (Google, Blogger help). However, no one has found the right solution. Therefore, I decided to create a guide on removing the "?m=1" URL parameter from Blogger.

Why Blogger Shows "?m=1" in Mobile URLs?

Before removing "?m=1" from the blogger URL, you must understand why it's showing and what it means. When does it occur? Basically, "?m=1" appears in the URL when a visitor visits your website from a mobile device. This "?m=1" represents that the website is opened on a mobile device.

If someone visits the Blogger website from a desktop computer or laptop, it won't appear. Mobile visitors only see this when they visit your website. Basically this "?m=1" represents the mobile devices.

Why You Need To Remove "?m=1" From Blogger URL?

Now let's discuss why you should remove "?m=1" from the blogger URL.

To be honest, there is no valid reason for it. The main reason is that the website owner does not like it. The website does not look as professional as a WordPress website.

Another reason is that it sometimes creates a canonical error in the search console. Despite the fact that the whole URL is the same, when a visitor views it from a mobile device, a ?m=1 is added. This results in canonical errors in the search engine.

These are the reasons why most bloggers dislike this type of URL. Now you must be clear about it. Let's look at how to remove ?m=1 from blogger URLs.

Steps to remove "?m=1" from Blogger

In this section we will talk about the steps to remove ?m=1 from the blog URL. Just follow these simple 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 script which is given below just below the <head> section of your blogger theme.

<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 theme and open your website in mobile device ?m=1 will be removed from the URL.

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>

The Bottom Line

If you use this script, you won't see much improvement in speed and the speed fluctuation isn't caused by this redirect, it is caused by the server response time. As a matter of fact, I do not use this script on my Blogger site. However, using this script does not cause any problems. 

If you have any questions about this post, please leave them in the comments section. Alternatively, you can post your concerns in the our Telegram Group.

Content Creator, Graphic Designer, UI / UX Designer & Coder.

Post a Comment

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, comment policy.