How to Remove ?m=1 from Blogger URLs

0
If you are a Blogger (Blogspot) user, you’ve likely noticed that annoying ?m=1 appended to the end of your URLs whenever someone visits your site from a smartphone. While Blogger uses this to serve mobile-optimized templates, it can look unprofessional, clutter your social media shares, and sometimes cause headaches for SEO.
​In this guide, I will show you how to hide ?m=1 from your address bar using a simple, lightweight script that won't slow down your site.

Why does Blogger add ?m=1?

​Blogger uses "Parameter Queries" to determine which version of your site to show:

  • ?m=1: Served to mobile devices.
  • ?m=0: Served to desktop devices (occasionally seen during redirects).

​While it helps Blogger’s internal system, most modern Responsive Themes don't actually need this parameter to look good. Removing it gives your site a "Premium" feel, similar to WordPress.

How to Hide ?m=1 without Breaking Your Site

We will use the HTML5 History API. This method is safe because it changes the URL in the browser bar after the page has loaded, meaning it doesn't interfere with Blogger's ability to load your mobile theme.

Step 1: Access Your Theme HTML

  1. ​Log in to your Blogger Dashboard.
  2. ​Navigate to the Theme tab on the left-hand menu.
  3. ​Click the down arrow next to the "Customize" button and select Edit HTML.

Step 2: Insert the Magic Script

​Scroll to the very bottom of your code and look for the </body> tag. Just above that tag, paste the following code:

Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<script type='text/javascript'>
//<![CDATA[
  (function() {
    var uri = window.location.toString();
    // This regex looks for ?m=1, &m=1, ?m=0, or &m=0 specifically
    if (uri.match(/[\?&]m=[01]/)) {
      // It replaces only the m=1 part and leaves the rest of the URL alone
      var clean_uri = uri.replace(/[\?&]m=[01]/g, "");
      window.history.replaceState({}, document.title, clean_uri);
    }
  })();
//]]>
</script>

Step 3: Save and Test

​Click the Save (Disk icon) at the top right. Now, open your blog on your phone. You will notice that for a split second, the ?m=1 appears, and then it immediately disappears, leaving you with a clean, professional URL!

Important SEO Bonus: The Canonical Tag

​To ensure Google doesn't get confused by the mobile and desktop versions of your pages, make sure your theme has a Canonical Tag.

​Search for <head> in your Blogger HTML and ensure this line is present near the top:

<link expr:href='data:blog.canonicalUrl' rel='canonical'/>

​This tells Google: "Even if you see ?m=1, the official version of this page is the clean URL."

Cleaning up your URLs is a small step that makes a huge difference in the user experience of your blog. It’s a "set it and forget it" trick that every professional Blogspot user should implement.

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.
Post a Comment (0)

buttons=(Accept !) days=(30)

Our website uses cookies to enhance your experience. Learn More about our cookie policy.
Accept !
To Top