-->

How To Remove ?m=1 From Blogger Blog? With Just A Script

By The All Point
Hostinger Banner Ad

Now We Are Going To Get Rid Of ?m=1 Suffix From Your Blogger Blog. Let's Know How To Remove ?m=1 From Our Blogger Blog Permanently By Just Using A Script.

How To Remove ?m=1 From Blogger Blog? With Just A Script

Introduction

Hi everyone! I have shown you how to create a free blog on Google Blogger in my previous article. After reading that article, many people created a free blog and started writing articles. But now the problem is when someone visit your blog homepage as well as any article, they will see a suffix(?m=1) after the url. This is called Mobile View Parameter.


What Is Mobile View Parameter in Blogger?

Mobile View Parameter in Blogger(Blogspot) differentiate Desktop View and Mobile View of your blog by adding this ?m=1 suffix for mobile devices just like this:
?m=1 after url in Blogger

Why Should You Remove ?m=1 From Your Blogger Blog?

  • It gives a bad SEO view when visited via mobile phone.
  • It increases the length of url which is not good.
  • It affects your GSC(Google Search Console) Report.
  • It redirects when visited via mobile. So, user will see a page loading twice like spammy websites.

Why Not To Remove ?m=1 From Your Blogger Blog?

First of all, it's impossible to remove ?m=1 from Blogger really. We can use just a tricky javascript to command browser to remove the ?m=1 Suffix. But crawler and robots crawl ?m=1.

 Changing URL can create deadlinks, which is bad for SEO. But still, If you want to remove ?m=1 from Blogger Blog, then follow my steps.


Steps To Remove ?m=1 from Blogger :

  1. Go to your Blogger Dashboard
  2. Select Theme Option
  3. Click on Edit HTML
  4. Search for '</head>' (click anywhere in the theme editor, and press Ctrl+F to search)
  5. Copy the Code mentioned below
  6. Paste the code above '</head>'
  7. Save the Theme
That's it. You have successfully applied the trick.

Code To Copy For Removing ?m=1 from Blogger -

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

 After pasting and saving the theme, you can visit any page of your blog in mobile phone. You will see there will no ?m=1 in URL Bar.

Conclusion :

I don't recommend you to do this. But still to give a better user experience to your visitors, then you can do this. To undo it, just remove the code from your theme. Share this article with your community if you like this article - 'How To Remove ?m=1 From Blogger Blog?'.