How to Remove ?m=1 from Blogger URL

How to Remove ?m=1 from Blogger URL: A Complete Guide for a Clean & SEO-Friendly Blog

How to Remove ?m=1 from Blogger URL
How to Remove ?m=1 from Blogger URL


If you are a Blogger (Blogspot) user, you have likely noticed that whenever you open your website on a mobile device, a suffix ?m=1 is automatically added to the end of your URL. For example, yourblog.com becomes yourblog.com/?m=1.
While this is a built-in feature of Google’s Blogger platform, many professional bloggers prefer a clean URL structure. In this article, we will dive deep into what this parameter is, why it exists, and how you can remove it using a simple script without affecting your site's performance.

What is ?m=1 in Blogger?

Blogger uses the ?m=1 parameter to distinguish between desktop and mobile traffic.

  • ?m=1: Indicates the mobile version of the site.
  • ?m=0: (Sometimes seen) indicates the desktop version.
  • This system was designed years ago when mobile web browsing was in its infancy. It helped Blogger’s servers serve a "lighter" version of your theme to mobile users to save data and improve loading speeds.

Why Should You Consider Removing It?

Before we jump into the "how," let’s discuss the "why." Is it just about looks, or does it help with SEO?

  1. Professional Appearance: A clean URL like example.com/post-name looks much more professional than example.com/post-name/?m=1.
  2. User Experience (UX): Users are more likely to share clean links. When a mobile user shares a link with ?m=1 to a desktop user, the desktop user might see the mobile-formatted version of the site, which often looks stretched or broken on large screens.
  3. Consistent Branding: Having a single, unified URL for every page helps in maintaining a solid brand identity across all devices.

Does Removing ?m=1 Affect SEO?

This is the most common concern. The short answer is: No, if done correctly.
Google is smart enough to know that ?m=1 is just a parameter. However, having multiple URLs for the same content (one with the parameter and one without) can sometimes lead to minor "canonicalization" confusion. By using a JavaScript method to hide the parameter, you aren't actually deleting the mobile version; you are simply cleaning up the address bar for the user.

How to Remove ?m=1 from Blogger (Step-by-Step)

To remove the ?m=1 suffix, we use a small piece of JavaScript that tells the browser to "rewrite" the URL in the address bar without reloading the page.

Step 1: Backup Your Theme

Before making any changes to your HTML, always go to Theme > Down Arrow > Backup. Safety first!

Step 2: Access the HTML Editor
  • Log in to your Blogger Dashboard.
  • Click on Theme in the left menu.
  • Click the down arrow next to the "Customize" button and select Edit HTML.

Step 3: Paste the Script
Scroll to the very bottom of the code and find the </body> tag. Copy the code below and paste it just above the </body> tag:


‎<script type='text/javascript'>
‎//<![CDATA[
‎/* Clean Blogger URL by CodeByZaibi */
‎var uri = window.location.toString();
‎if (uri.indexOf("%3Fm%3D1", uri.length - 8) !== -1) {
‎  var clean_uri = uri.substring(0, uri.length - 8);
‎  window.history.replaceState({}, document.title, clean_uri);
‎}
‎if (uri.indexOf("?m=1", uri.length - 4) !== -1) {
‎  var clean_uri = uri.substring(0, uri.length - 4);
‎  window.history.replaceState({}, document.title, clean_uri);
‎}
‎//]]>
‎</script>
‎

Step 4: Save and Test
Click the Save icon (diskette symbol). Now, open your blog on your mobile phone. You will see the ?m=1 appear for a split second and then vanish, leaving you with a clean URL!

Common Troubleshooting
  • The code isn't working: Ensure you placed it before </body> and not inside another script tag.
  • Redirect Loops: If your site keeps refreshing, remove the code immediately. This usually happens if you have other conflicting redirection scripts.
  • AdSense Ads: This script is generally safe for AdSense, as it uses window.history.replaceState, which is a standard web practice that doesn't trigger "invalid traffic" issues.

Conclusion
Removing the ?m=1 parameter is a small but effective step in making your Blogspot site feel like a premium, self-hosted WordPress site. It improves the aesthetic appeal of your links and makes sharing much easier for your readers.
While Blogger is a free platform, these little "hacks" allow you to push its limits and create a high-quality experience for your audience.