Ankaj Gupta
May 02, 2021

How to remove ? m=1 or ?m=0 from blogger post URL

Remove ?m=1 From Blogger Post URL

A common question that every blogger searches for is how to remove ?m=1 or ?m=0 from Blogger post URLs. We all know that "simplicity is beauty" and you want a clean permalink. This guide will help you remove these parameters and create professional, clean URLs for your blog posts.

Why Remove ?m=1?

The ?m=1 parameter appears when users access your blog from mobile devices. Removing it provides several benefits.

  • Professional Permalink: Gives your blog posts cleaner, more professional URLs
  • Better SEO: Helps improve ranking in Search Engine Result Pages
  • Shorter URLs: Makes your blog post URLs shorter and easier to share
  • User Experience: Cleaner URLs look more trustworthy and professional

Step-by-Step Tutorial

Follow these simple steps to remove ?m=1 from your Blogger post URLs:

Step 1: Login to Blogger Dashboard

First, log in to your Blogger dashboard and select your blog.

How to remove m1 from blogger url

Step 2: Navigate to Theme Section

Click on the Theme option in your Blogger dashboard.

Fix Blogger m=1 Duplicate Content Issue

Step 3: Click on Customize

Click on the Customise button to access theme settings.

Remove ?m=1, ?m=0 suffix when visiting from mobile

Step 4: Access Edit HTML

Click on Edit HTML option to modify your theme code.

How to Remove ?m=1 From Website URL On Mobile

Step 5: Find the </head> Tag

Press (CTRL + F) from your keyboard and type /head to find the closing head tag.

New Blogger Easily Remove ?m=1 from Your Website with code

Step 6: Add the Code

Paste the below code just above the </head> tag.

How to remove ? m=1 from URL in 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>

Step 7: Save Settings

Finally, click on the Save icon to save your settings and code.

Removing ?m=1 From Blogger

How the Code Works

The JavaScript code works by:

  • Getting the current URL using window.location.toString()
  • Checking if the URL contains various encoded or unencoded versions of m=1
  • Extracting the clean URL by removing the unwanted parameters
  • Using window.history.replaceState() to update the URL without reloading the page

Code Breakdown

URL Encoding Handling

The code handles both encoded %3D and unencoded = versions.

Multiple Parameter Checks

Checks for ?m=1, &m=1, and their encoded forms.

No Page Reload

Uses replaceState() instead of pushState() to avoid adding to browser history.

Just save and go to mobile and check the permalink/URL of your Blogger post. You will see that ?m=1 or ?m=0 has been removed. Now enjoy clean, professional URLs! Happy Blogging! :)

Summary

Removing the ?m=1 parameter from Blogger URLs is a simple but effective way to improve your blog's professionalism and SEO. The JavaScript solution provided here works seamlessly across all devices and automatically cleans URLs without requiring any additional configuration.

The code is safe, lightweight, and doesn't affect your blog's performance or functionality. It simply removes the unwanted parameters from the URL when users visit your blog from mobile devices.

Recommended Posts

Blogger blogging

Join the discussion

Comments

6 comments
Apollo Medical Ptv Ltd is here to provide you affordable medical billing services around the globe. Our trained and certified coding specialist are here to help you provide medical billing soultions. Get our services today!

medical billing
Glad to visit this blog, really helpful. Gathered lots of information and waiting to see more updates.
PHP website development
Use Blogger Sitemap Generator And Create a Free XML Sitemap for your blogger/blogspot website.
Hi, I found your blog with good instruction. Love it

Related Posts