How to Remove “?M=1” From Blogger URL: In 2 Min

As you know Blogspot shows ?m=1 in the URL when someone visits the site from any Mobile devices. It looks a little bad and most of the users do not like this.

Having a clean URL gives your website a professional look and you do not want separate URLs for Desktop and Mobile devices.

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

Why does Blogger show ?m=1 in Mobile URLs?

Blogspot is quite outdated now and earlier most of the Blogger themes did not use the responsive design. Most themes show different versions for Desktop and mobile users.

So, to identify the Device properly Blogger introduces the concept of the ?m=1 parameter in the blogger URL. So, whenever someone accesses your Blog from a mobile or tablet it will show a URL structure like this.

https://www.yourdomain.com/?m=1

As most modern themes use a responsive design and do not display separate versions for different screen sizes there is no need to change this URL parameter.

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 is 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 the blogger URL follow the below steps.


Step 1

Go to the blogger dashboard and select the theme option.

How to Remove “?M=1” From Blogger URL: In 2 Min


Step 2

Now click on the (edit HTML) option from the drop-down menu.

How to Remove “?M=1” From Blogger URL: In 2 Min


Step 3

Now you have to add the below script just below the <head> tag.

How to Remove “?M=1” From Blogger URL: In 2 Min
Here Is Script
<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.

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

Does it affect your blog SEO and does it improve the speed of blogger?

Well the answer is a little tricky. Using this script does not remove the ?m=1 from the blogger URL permanently. Instead it again redirects this URL to the original URL in the user Browser.

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

And remember that it does not improve the speed that much and the speed fluctuation is not due to this redirect it is due to the server response time.

In fact I am not using this script on my blogger site. But there is no problem using this script.

Removing the ?m=1 from the mobile URL gives your website a professional look and you can try this on your website only if the site is new and does not have much post published yet.

Conclusion:

Take a 2 minutes to follow the simple 4 steps above, and you will easily remove the ?M=1 parameter from your Blogger URLs. This not only enhances the SEO of your blog but also makes it look cleaner to visitors. Maintain optimization of your blog and enjoy performing better still both on your desktop and mobile devices.

FAQs:

What does the URL query parameter ?M=1 stand for in Blogger?

It stands for a mobile version of any blog page. It appears at the ends of viewed pages' addresses if they are accessed by mobile devices.

Will this JavaScript hurt my performance on the blog? 

No, as the script is rather light and runs in session time; it will not affect your blog performance.

Reduces SEO strength? 

Yes, positively. There is no more issue about duplicate content and the URL remains constant, which is positive for SEO.

Can this be done so that ?M=1 does not appear without going into theme code? 

No, at least now that adding custom JavaScript to your theme is one of the most excellent ways to remove the ?M=1.

Next Post Previous Post
No Comment
Add Comment
comment url